This project is archived and is in readonly mode.
+before_create+, +after_create+, +before_destroy+ and +after_destroy+ callbacks for AR collection associations
Reported by Lawrence Pit | September 27th, 2009 @ 07:19 AM
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.
Comments and changes to this ticket
-
Lawrence Pit September 27th, 2009 @ 08:50 AM
- no changes were found...
-
Eloy Duran September 28th, 2009 @ 09:43 AM
- Assigned user set to Michael Koziarski
-
Rohit Arondekar October 6th, 2010 @ 06:41 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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2100 Change behaviour of association's after_add callback I filed a ticket earlier for this: see #3277