From 08318b8bcd32bae741e672899a33c6a7d52664c8 Mon Sep 17 00:00:00 2001 From: Josh Peek Date: Fri, 4 Apr 2008 20:26:42 +0000 Subject: Replaced callback method evaluation in AssociationCollection class to use ActiveSupport::Callbacks. Modified ActiveSupport::Callbacks::Callback#call to accept multiple arguments. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/filters.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/filters.rb b/actionpack/lib/action_controller/filters.rb index 218a9c0b80..73721cd1ec 100644 --- a/actionpack/lib/action_controller/filters.rb +++ b/actionpack/lib/action_controller/filters.rb @@ -385,8 +385,14 @@ module ActionController #:nodoc: def call(controller, &block) if should_run_callback?(controller) - proc = filter_responds_to_before_and_after? ? around_proc : method - evaluate_method(proc, controller, &block) + method = filter_responds_to_before_and_after? ? around_proc : self.method + + # For around_filter do |controller, action| + if method.is_a?(Proc) && method.arity == 2 + evaluate_method(method, controller, block) + else + evaluate_method(method, controller, &block) + end else block.call end -- cgit v1.2.3