Permalink
Browse files

Added support to new callbacks for around filter object that respond …

…to :before & :after used in before|after callbacks
  • Loading branch information...
1 parent 2b166d3 commit 1e2628431a742e4f67af1d5dc1db8ad6393e8832 Yehuda Katz + Carl Lerche committed May 27, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 activesupport/lib/active_support/new_callbacks.rb
@@ -324,7 +324,11 @@ def #{method_name}(&blk)
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

0 comments on commit 1e26284

Please sign in to comment.