From 63992e8f3af48d34d70ce33828c93625af9e8562 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 30 May 2009 15:14:23 +0100 Subject: [PATCH] Support Object#filter method for before/after filters --- activesupport/lib/active_support/new_callbacks.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb index f1d2ea7bb1..8512c659b0 100644 --- a/activesupport/lib/active_support/new_callbacks.rb +++ b/activesupport/lib/active_support/new_callbacks.rb @@ -326,6 +326,8 @@ def #{method_name}(&blk) def #{method_name}(&blk) if #{method_name}_object.respond_to?(:#{kind}) #{method_name}_object.#{kind}(self, &blk) + elsif #{method_name}_object.respond_to?(:filter) + #{method_name}_object.send("filter", self, &blk) else #{method_name}_object.send("#{kind}_#{name}", self, &blk) end -- GitLab