Permalink
Browse files

simplify filter enabled checking

  • Loading branch information...
1 parent 57d3817 commit c6c6ffbd621f8bccfdda0431e7cc8cc5529b1c3b @tenderlove tenderlove committed Oct 18, 2012
Showing with 4 additions and 9 deletions.
  1. +4 −9 actionpack/lib/action_dispatch/http/parameter_filter.rb
@@ -1,26 +1,21 @@
module ActionDispatch
module Http
class ParameterFilter
-
def initialize(filters)
@filters = filters
end
def filter(params)
- if enabled?
- compiled_filter.call(params)
- else
+ if @filters.empty?
params.dup
+ else
+ compiled_filter.call(params)
end
end
private
- def enabled?
- @filters.present?
- end
-
- FILTERED = '[FILTERED]'.freeze
+ FILTERED = '[FILTERED]'
def compiled_filter
@compiled_filter ||= begin

0 comments on commit c6c6ffb

Please sign in to comment.