From 734c69f2410da11b92c8da236227eb564853352c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 27 Apr 2005 06:42:12 +0000 Subject: Added conditions to around_filters just like before_filter and after_filter git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1238 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/filters.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/filters.rb b/actionpack/lib/action_controller/filters.rb index 83e3045859..7652d8803c 100644 --- a/actionpack/lib/action_controller/filters.rb +++ b/actionpack/lib/action_controller/filters.rb @@ -202,10 +202,11 @@ module ActionController #:nodoc: # A#after # B#after def append_around_filter(*filters) + conditions = extract_conditions!(filters) for filter in filters.flatten ensure_filter_responds_to_before_and_after(filter) - append_before_filter { |c| filter.before(c) } - prepend_after_filter { |c| filter.after(c) } + append_before_filter(conditions || {}) { |c| filter.before(c) } + prepend_after_filter(conditions || {}) { |c| filter.after(c) } end end -- cgit v1.2.3