title: Trouble with cascading in Active Record models
body: <p>I have these active record models in my application</p>
  
  <pre><code>class Artist &lt; ActiveRecord::Base
     has_many :albums, :dependent =&gt; :delete_all, autosave: true
  end
  
  class Album &lt; ActiveRecord::Base
     attr_accessor :album_artist
     has_many :tracks, :dependent =&gt; :delete_all, autosave: true
     has_many :covers, :dependent =&gt; :delete_all, autosave: true
     belongs_to :artist
  end
  
  class Track &lt; ActiveRecord::Base
     belongs_to :album
  end
  
  class Cover &lt; ActiveRecord::Base
     belongs_to :album
  end
  </code></pre>
  
  <p>I'm trying, in my application, when i delete an Artist, his albums and, in consequence, the tracks and covers of his albums, get all deleted, in a cascade reaction.</p>
  
  <p>The way it's implemented today, when i delete the Artist, only the Album is deleted too, leaving orphan records in my database.</p>
  
  <p>Am i doin' anything wrong?</p>