mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Added support to new callbacks for around filter object that respond to :before & :after
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user