diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-27 06:42:12 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-27 06:42:12 +0000 |
commit | 734c69f2410da11b92c8da236227eb564853352c (patch) | |
tree | d1bd85cebf2f4a003af2b7d17077a9f9eb0e7a86 /actionpack | |
parent | b09fde1924494d74d10391764fb5419119d4f8cd (diff) | |
download | rails-734c69f2410da11b92c8da236227eb564853352c.tar.gz rails-734c69f2410da11b92c8da236227eb564853352c.tar.bz2 rails-734c69f2410da11b92c8da236227eb564853352c.zip |
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
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/filters.rb | 5 |
1 files 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 |