aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2012-09-21 12:58:14 +0300
committerSteve Klabnik <steve@steveklabnik.com>2012-09-21 12:58:14 +0300
commit79cbfc8290f08212faecdb32cea585c435091e87 (patch)
tree2726efb4050e313a22ac38f76969c34d1a901456 /activerecord/lib/active_record
parent79942d426d28bcb726c1aedcae00fb07c34ae766 (diff)
downloadrails-79cbfc8290f08212faecdb32cea585c435091e87.tar.gz
rails-79cbfc8290f08212faecdb32cea585c435091e87.tar.bz2
rails-79cbfc8290f08212faecdb32cea585c435091e87.zip
Add extra note about :dependent => :destroy.
Callbacks may interfere with each other.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 577b87e708..d8ab039cec 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1100,7 +1100,10 @@ module ActiveRecord
# Specify the method that returns the primary key used for the association. By default this is +id+.
# [:dependent]
# Controls what happens to the associated objects when
- # their owner is destroyed:
+ # their owner is destroyed. Note that these are implemented as
+ # callbacks, and Rails executes callbacks in order. Therefore, other
+ # similar callbacks may affect the :dependent behavior, and the
+ # :dependent behavior may affect other callbacks.
#
# * <tt>:destroy</tt> causes all the associated objects to also be destroyed
# * <tt>:delete_all</tt> causes all the asssociated objects to be deleted directly from the database (so callbacks will not execute)