Skip to content

Commit

Permalink
Add extra note about :dependent => :destroy.
Browse files Browse the repository at this point in the history
Callbacks may interfere with each other.
  • Loading branch information
steveklabnik committed Sep 21, 2012
1 parent 79942d4 commit 79cbfc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion activerecord/lib/active_record/associations.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 79cbfc8

Please sign in to comment.