This project is archived and is in readonly mode.
Add ActiveRecord::Base#delete instance method
Reported by Hongli Lai | September 21st, 2008 @ 10:17 PM | in 2.x
This patch adds an ActiveRecord::Base#delete instance method. It's like #destroy, but it doesn't call before_destroy callbacks and such.
This patch: - makes the API more consistent. I found it weird that there's Base.delete, Base.destroy, Base.delete_all and Base.destroy_all, but no Base#delete. - adds a plugin hook that I need. I also modified the autogenerated has_one/belongs_to before_destroy callbacks to call 'association.delete' instead of 'association.class.delete(association.id)'.
Comments and changes to this ticket
-
Hongli Lai September 21st, 2008 @ 10:29 PM
Updated the #delete implementation per Pratik's suggestion.
-
Repository September 21st, 2008 @ 10:55 PM
- State changed from new to resolved
(from [46939a9b5a0098fddeac99a8a4331f66bdd0710e]) Add Model#delete instance method, similar to Model.delete class method. [#1086 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
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
Tags
Referenced by
- 1086 Add ActiveRecord::Base#delete instance method (from [46939a9b5a0098fddeac99a8a4331f66bdd0710e]) Add Mod...