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
上级 38591db1
...@@ -78,6 +78,10 @@ module ActiveRecord ...@@ -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 # 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. # 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 # == Types of callbacks
# #
# There are four types of callbacks accepted by the callback macros: Method references (symbol), callback objects, # There are four types of callbacks accepted by the callback macros: Method references (symbol), callback objects,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册