diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-06-14 16:18:29 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-06-14 16:18:29 -0400 |
commit | e4c8bc1b34867edccf3f515423fab19fae867b4f (patch) | |
tree | dbab90170c59a9d883c57b5c031ed93c75d9f44a /activesupport/lib | |
parent | ed9a183ea4bfb825d4468100fc6f5ccf3084da59 (diff) | |
download | rails-e4c8bc1b34867edccf3f515423fab19fae867b4f.tar.gz rails-e4c8bc1b34867edccf3f515423fab19fae867b4f.tar.bz2 rails-e4c8bc1b34867edccf3f515423fab19fae867b4f.zip |
adding to the :kind documentation for ActiveSupport callbacks
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 466f6baea8..92a4635011 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -565,6 +565,11 @@ module ActiveSupport # passed. In the above case method "before_save" is constructed by calling "#{kind}_#{name}" # in the given class. In this case "kind" is "before" and "name" is "save". # + # Although ":kind" is the default scope that is passed, it is possible to not to make use of ":kind". + # define_callbacks :save, :scope => [:name] . A declaration like this would call "save" method of + # Audit class since ":kind" is skipped. + # + # def define_callbacks(*callbacks) config = callbacks.last.is_a?(Hash) ? callbacks.pop : {} callbacks.each do |callback| |