title: Delete object in a has_many through relationship with :dependent => :destroy Rails 3.2
body: <p>Im working on a Rails app where users can create projects. There are two types of users <code>Admins</code> and <code>Collaborators</code>. Both Admins and Collaborators <code>has_many :accounts, through: :account_users</code>, where account_users is a join table. When Admins deletes their accounts, I also want to delete their created account and it's project, but I can't get this to work. My models currently looks like this:</p>
  
  <pre><code>class Collaborator &lt; User
    [...]  
    has_many :account_users
    has_many :accounts, through: :account_users
    [...]
  end
  
  class Admin &lt; User
    has_many :account_users
    has_many :accounts, through: :account_users, :dependent =&gt; :destroy
    [...]
  end 
  
  class Account &lt; ActiveRecord::Base
    [...]
    belongs_to :admin
    has_many :account_users
    has_many :collaborators, through: :account_users
    [...]
  end
  
  
  class AccountUser &lt; ActiveRecord::Base
    belongs_to :admin
    belongs_to :account
    belongs_to :collaborator
  end
  </code></pre>
  
  <p>When a Admin users deletes it's account, only the row in the join table and user table is deleted, their projects isn't deleted. </p>
  
  <p>Note, I use devise for handling authentication.</p>
  
  <p>How could I solve this?</p>