aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/new_callbacks.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-05-30 15:14:23 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-05-30 15:14:23 +0100
commit63992e8f3af48d34d70ce33828c93625af9e8562 (patch)
treea46f8d7a816ed3a21a5364bd35cee289474f9d07 /activesupport/lib/active_support/new_callbacks.rb
parent669fd84910586d4c791b6f5bf4320f68ac7845aa (diff)
downloadrails-63992e8f3af48d34d70ce33828c93625af9e8562.tar.gz
rails-63992e8f3af48d34d70ce33828c93625af9e8562.tar.bz2
rails-63992e8f3af48d34d70ce33828c93625af9e8562.zip
Support Object#filter method for before/after filters
Diffstat (limited to 'activesupport/lib/active_support/new_callbacks.rb')
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb2
1 files changed, 2 insertions, 0 deletions
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 @@ module ActiveSupport
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