aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/new_callbacks.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-27 16:49:23 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-27 16:49:23 -0700
commit2b166d306c7829c8be531cb030515166367cbb20 (patch)
tree72ecfe9e2bfcd89db97eb5dfbf27177b2311989e /activesupport/lib/active_support/new_callbacks.rb
parentbd7e3dc47d8ab4da1028c9c18c94474178f84bdd (diff)
downloadrails-2b166d306c7829c8be531cb030515166367cbb20.tar.gz
rails-2b166d306c7829c8be531cb030515166367cbb20.tar.bz2
rails-2b166d306c7829c8be531cb030515166367cbb20.zip
Added support to new callbacks for around filter object that respond to :before & :after
Diffstat (limited to 'activesupport/lib/active_support/new_callbacks.rb')
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb
index e9a30b9c35..5ca6b90b01 100644
--- a/activesupport/lib/active_support/new_callbacks.rb
+++ b/activesupport/lib/active_support/new_callbacks.rb
@@ -311,6 +311,11 @@ module ActiveSupport
def #{method_name}(&blk)
if :#{kind} == :around && #{method_name}_object.respond_to?(:filter)
#{method_name}_object.send("filter", self, &blk)
+ # TODO: Deprecate this
+ elsif #{method_name}_object.respond_to?(:before) && #{method_name}_object.respond_to?(:after)
+ #{method_name}_object.before(self)
+ yield
+ #{method_name}_object.after(self)
else
#{method_name}_object.send("#{kind}_#{name}", self, &blk)
end