Permalink
Browse files

Add extra note about :dependent => :destroy.

Callbacks may interfere with each other.
  • Loading branch information...
1 parent 79942d4 commit 79cbfc8290f08212faecdb32cea585c435091e87 @steveklabnik steveklabnik committed Sep 21, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 activerecord/lib/active_record/associations.rb
View
5 activerecord/lib/active_record/associations.rb
@@ -1100,7 +1100,10 @@ module ClassMethods
# 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)

0 comments on commit 79cbfc8

Please sign in to comment.