From 3c1a0a8b62cafe50a9098fa1f925db25c6c63767 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Mon, 13 Dec 2010 22:13:33 -0500 Subject: expand on set_callback method to explain that in some cases an implicit :before is assumed --- activesupport/lib/active_support/callbacks.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/lib') 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 -- cgit v1.2.3