Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 734c69f2410da11b92c8da236227eb564853352c 1 parent b09fde1
@dhh dhh authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_controller/filters.rb
View
5 actionpack/lib/action_controller/filters.rb
@@ -202,10 +202,11 @@ def prepend_after_filter(*filters, &block)
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.