Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

expand on set_callback method to explain that in

some cases an implicit :before is assumed
  • Loading branch information...
commit 3c1a0a8b62cafe50a9098fa1f925db25c6c63767 1 parent 68ebd33
@neerajdotname neerajdotname authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 activesupport/lib/active_support/callbacks.rb
View
4 activesupport/lib/active_support/callbacks.rb
@@ -447,6 +447,10 @@ def __update_callbacks(name, filters = [], block = nil) #:nodoc:
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.