This project is archived and is in readonly mode.

#3512 ✓stale
Shane Liebling

Adding functionality such that :destroy method is called on a has_many :through association that is :dependent => :destroy

Reported by Shane Liebling | November 25th, 2009 @ 09:44 PM

On line 73 of activerecord/lib/active_record/associations/has_many_through_association.rb there is a TODO to provide "dependent option support." I am providing a patch to handle this. Now if there is a :dependent => :destroy condition for the HMT association destroy_all will be called instead of delete_all. This means any callbacks that should be triggered will now be triggered by the destruction of the association objects.

Comments and changes to this ticket

  • Shane Liebling

    Shane Liebling November 25th, 2009 @ 09:45 PM

    • Tag changed from patch to :dependent, :destroy, has_many_through, patch
  • Rohit Arondekar

    Rohit Arondekar October 6th, 2010 @ 06:30 AM

    • State changed from “new” to “stale”
    • Importance changed from “” to “”

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>