diff options
author | Josh Peek <josh@joshpeek.com> | 2008-04-04 20:26:42 +0000 |
---|---|---|
committer | Josh Peek <josh@joshpeek.com> | 2008-04-04 20:26:42 +0000 |
commit | 08318b8bcd32bae741e672899a33c6a7d52664c8 (patch) | |
tree | 5f7b491567621560d1c618e93fb8ab15155a3dbf /actionpack/lib/action_controller | |
parent | 36b8073ff553e8939d78ca2371ffdec7eb8f8071 (diff) | |
download | rails-08318b8bcd32bae741e672899a33c6a7d52664c8.tar.gz rails-08318b8bcd32bae741e672899a33c6a7d52664c8.tar.bz2 rails-08318b8bcd32bae741e672899a33c6a7d52664c8.zip |
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
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/filters.rb | 10 |
1 files changed, 8 insertions, 2 deletions
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 |