提交 76d2c455 编写于 作者: C chrisfinne 提交者: Rizwan Reza

Add debugging documentation for _callback_chain to ActiveRecord::Callback

Signed-off-by: NRizwan Reza <rizwanreza@gmail.com>
上级 ffb22bd2
......@@ -205,6 +205,16 @@ module ActiveRecord
# including <tt>after_*</tt> hooks. Note, however, that in that case the client
# needs to be aware of it because an ordinary +save+ will raise such exception
# instead of quietly returning +false+.
#
# == Debugging callbacks
#
# To list the methods and procs registered with a particular callback, append <tt>_callback_chain</tt> to the callback name that you wish to list and send that to your class from the Rails console:
#
# >> Topic.after_save_callback_chain
# => [#<ActiveSupport::Callbacks::Callback:0x3f6a448
# @method=#<Proc:0x03f9a42c@/Users/foo/bar/app/models/topic.rb:43>, kind:after_save, identifiernil,
# options{}]
#
module Callbacks
extend ActiveSupport::Concern
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册