From 7da89e9ae74b5f549c286f68c2fc2faba4958270 Mon Sep 17 00:00:00 2001 From: "Hongli Lai (Phusion)" Date: Sun, 21 Sep 2008 22:39:17 +0200 Subject: In ActiveRecord::Base#destroy's documention, also mention that before/after_delete callbacks and :dependent callbacks are run. --- activerecord/lib/active_record/base.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 13393ce6a9..fa406a82b1 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2386,6 +2386,9 @@ module ActiveRecord #:nodoc: # 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, "#{self.class.name} Destroy" -- cgit v1.2.3