Browse files

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

…/after_delete callbacks and :dependent callbacks are run.
  • Loading branch information...
1 parent 353dc9d commit 7da89e9ae74b5f549c286f68c2fc2faba4958270 @FooBarWidget FooBarWidget committed Sep 21, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 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"

0 comments on commit 7da89e9

Please sign in to comment.