Browse files

Added warning about specifying callbacks before associations to trigg…

…er inheritance

git-svn-id: 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 38591db commit 8ccbe90a07560f17d71b45a1b8b1fc34b1d7b7d6 @dhh dhh committed Mar 19, 2005
Showing with 4 additions and 0 deletions.
  1. +4 −0 activerecord/lib/active_record/callbacks.rb
4 activerecord/lib/active_record/callbacks.rb
@@ -78,6 +78,10 @@ module ActiveRecord
# you want to ensure that a certain callback is called for the entire hierarchy and the regular overwriteable methods when you
# want to leave it up to each descendent to decide whether they want to call +super+ and trigger the inherited callbacks.
+ # *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the callbacks before specifying the
+ # associations. Otherwise, you might trigger the loading of a child before the parent has registered the callbacks and they won't
+ # be inherited.
+ #
# == Types of callbacks
# There are four types of callbacks accepted by the callback macros: Method references (symbol), callback objects,

0 comments on commit 8ccbe90

Please sign in to comment.