diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-19 15:36:41 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-19 15:36:41 +0000 |
commit | 8ccbe90a07560f17d71b45a1b8b1fc34b1d7b7d6 (patch) | |
tree | 57e4d5d6323090f18e4dad96f703fed92cb2e0fb | |
parent | 38591db14ff43540cfc039d8fa9aa0001a8de7b8 (diff) | |
download | rails-8ccbe90a07560f17d71b45a1b8b1fc34b1d7b7d6.tar.gz rails-8ccbe90a07560f17d71b45a1b8b1fc34b1d7b7d6.tar.bz2 rails-8ccbe90a07560f17d71b45a1b8b1fc34b1d7b7d6.zip |
Added warning about specifying callbacks before associations to trigger inheritance
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@917 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-x | activerecord/lib/active_record/callbacks.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index f92e38a0d0..23675c3bd4 100755 --- a/activerecord/lib/active_record/callbacks.rb +++ b/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, |