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.

+before_create+, +after_create+, +before_destroy+ and +after_destroy+ callbacks for AR collection associations

#3277

I have a need to log / audit changes to has_many and has_and_belongs_to_many records. Especially has_and_belongs_to_many associations are currently hard to audit because when the owner is new the after_add/after_remove callbacks are called before the owner is actually saved to the database. Also, with the relatively new :autosave option for AR associations the same issue occurs.

This patch adds the ability to define +before_create+, +after_create+, +before_destroy+ and +after_destroy+ callbacks on AR collection associations. The patch is made against 2-3-stable.

Reported by Lawrence Pit · September 27th, 2009 @ 07:19 AM

State: stale
Milestone: none
Assigned to: Michael Koziarski Michael Koziarski
Importance: none

Activity

  1. Lawrence Pit
  2. Eloy Duran
    Eloy Duran
    • Assigned user set to Michael Koziarski

    September 28th, 2009 @ 09:43 AM

  3. 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:41 AM