This project is archived and is in readonly mode.

#1086 ✓resolved
Hongli Lai

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

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

Referenced by

Pages