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.

Add ActiveRecord::Base#delete instance method

#1086

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)'.

Reported by Hongli Lai · September 21st, 2008 @ 10:17 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Hongli Lai
    Hongli Lai

    Updated the #delete implementation per Pratik's suggestion.

    September 21st, 2008 @ 10:29 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [46939a9b5a0098fddeac99a8a4331f66bdd0710e]) Add Model#delete instance method, similar to Model.delete class method. [#1086 Add ActiveRecord::Base#delete instance method state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    September 21st, 2008 @ 10:55 PM