Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#3512

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.

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

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Shane Liebling
    Shane Liebling
    • Tag changed from patch to :dependent, :destroy, has_many_through, patch

    November 25th, 2009 @ 09:45 PM

  2. Rohit Arondekar
    Rohit Arondekar
    • 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.

    October 6th, 2010 @ 06:30 AM