diff options
author | chrisfinne <chris.finne@gmail.com> | 2010-01-09 05:36:59 -0800 |
---|---|---|
committer | Rizwan Reza <rizwanreza@gmail.com> | 2010-03-26 14:01:21 +0430 |
commit | 76d2c455c0607b4cd5f238cadef8f933a18567fb (patch) | |
tree | f216752d131ebdf8a690c71e4519245a3b4e0514 /activerecord | |
parent | ffb22bd2be62e6a9a2eb11966e9bc07fee8722af (diff) | |
download | rails-76d2c455c0607b4cd5f238cadef8f933a18567fb.tar.gz rails-76d2c455c0607b4cd5f238cadef8f933a18567fb.tar.bz2 rails-76d2c455c0607b4cd5f238cadef8f933a18567fb.zip |
Add debugging documentation for _callback_chain to ActiveRecord::Callback
Signed-off-by: Rizwan Reza <rizwanreza@gmail.com>
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/callbacks.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 1128286f2b..add5d99ca6 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -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 |