aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorHongli Lai (Phusion) <hongli@phusion.nl>2008-09-21 22:39:17 +0200
committerHongli Lai (Phusion) <hongli@phusion.nl>2008-09-21 22:39:17 +0200
commit7da89e9ae74b5f549c286f68c2fc2faba4958270 (patch)
tree2afa96ee7a822afae579001870e612a86cc9222d /activerecord
parent353dc9d389f5d62c320c17eb9c7bb1acfc480952 (diff)
downloadrails-7da89e9ae74b5f549c286f68c2fc2faba4958270.tar.gz
rails-7da89e9ae74b5f549c286f68c2fc2faba4958270.tar.bz2
rails-7da89e9ae74b5f549c286f68c2fc2faba4958270.zip
In ActiveRecord::Base#destroy's documention, also mention that before/after_delete callbacks and :dependent callbacks are run.
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb3
1 files changed, 3 insertions, 0 deletions
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"