diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/new_callbacks.rb | 5 |
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 |