diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-12-13 22:13:33 -0500 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-12-21 15:45:50 -0500 |
commit | 3c1a0a8b62cafe50a9098fa1f925db25c6c63767 (patch) | |
tree | c367061811844296769340906fddd5a9e4e82cb0 /activesupport | |
parent | 68ebd332d0588f6d1299a06f726f9f508e418c76 (diff) | |
download | rails-3c1a0a8b62cafe50a9098fa1f925db25c6c63767.tar.gz rails-3c1a0a8b62cafe50a9098fa1f925db25c6c63767.tar.bz2 rails-3c1a0a8b62cafe50a9098fa1f925db25c6c63767.zip |
expand on set_callback method to explain that in
some cases an implicit :before is assumed
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 844237fe6a..32ebea8571 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -447,6 +447,10 @@ module ActiveSupport # set_callback :save, :after, :after_meth, :if => :condition # set_callback :save, :around, lambda { |r| stuff; yield; stuff } # + # If the second argument is not :before, :after or :around then an implicit :before is assumed. + # It means the first example mentioned above can also be written as: + # set_callback :save, :before_meth + # # Use skip_callback to skip any defined one. # # When creating or skipping callbacks, you can specify conditions that |