From a59858c3752a080392839f5167f008086f93bb00 Mon Sep 17 00:00:00 2001 From: chrisfinne Date: Sat, 9 Jan 2010 05:36:59 -0800 Subject: [PATCH] Add debugging documentation for _callback_chain to ActiveRecord::Callback --- 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 aecde58..b0ced40 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -205,6 +205,16 @@ module ActiveRecord # including after_* 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 _callback_chain to the callback name that you wish to list and send that to your class from the Rails console: + # + # >> Topic.after_save_callback_chain + # => [#, kind:after_save, identifiernil, + # options{}] + # module Callbacks extend ActiveSupport::Concern -- 1.6.1.3