Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

In ActiveRecord::Base#destroy's documention, also mention that before…

…/after_delete callbacks and :dependent callbacks are run.
  • Loading branch information...
commit 7da89e9ae74b5f549c286f68c2fc2faba4958270 1 parent 353dc9d
@FooBarWidget FooBarWidget authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  activerecord/lib/active_record/base.rb
3  activerecord/lib/active_record/base.rb
@@ -2386,6 +2386,9 @@ def save!
# Deletes the record in the database and freezes this instance to reflect that no changes should
# be made (since they can't be persisted).
+ #
+ # In addition to deleting this record, any defined +before_delete+ and +after_delete+
+ # callbacks are run, and +:dependent+ rules defined on associations are run.
def destroy
unless new_record?
connection.delete <<-end_sql, "#{} Destroy"
Please sign in to comment.
Something went wrong with that request. Please try again.