aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-27 16:50:40 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-27 16:50:40 -0700
commit1e2628431a742e4f67af1d5dc1db8ad6393e8832 (patch)
treeb5bdbdf9f2a6461dc072e29497cdbfa3c5e3801b /activesupport/lib/active_support
parent2b166d306c7829c8be531cb030515166367cbb20 (diff)
downloadrails-1e2628431a742e4f67af1d5dc1db8ad6393e8832.tar.gz
rails-1e2628431a742e4f67af1d5dc1db8ad6393e8832.tar.bz2
rails-1e2628431a742e4f67af1d5dc1db8ad6393e8832.zip
Added support to new callbacks for around filter object that respond to :before & :after used in before|after callbacks
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb
index 5ca6b90b01..185fb6a6af 100644
--- a/activesupport/lib/active_support/new_callbacks.rb
+++ b/activesupport/lib/active_support/new_callbacks.rb
@@ -324,7 +324,11 @@ module ActiveSupport
else
@klass.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
def #{method_name}(&blk)
- #{method_name}_object.send("#{kind}_#{name}", self, &blk)
+ if #{method_name}_object.respond_to?(:#{kind})
+ #{method_name}_object.#{kind}(self, &blk)
+ else
+ #{method_name}_object.send("#{kind}_#{name}", self, &blk)
+ end
end
RUBY_EVAL
end