aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib')
-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