Skip to content

Commit

Permalink
standardize arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyconvict committed Aug 18, 2016
1 parent a32a4a6 commit 21d1534
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cache_key_for/cache_key_for_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def cache_key_for(scoped_collection, collection_prefix, cache_owner_cache_key =
blacklist_params = ['utm_source', 'utm_medium', 'utm_term', 'utm_content', 'utm_campaign']
request_params = if request.params
if whitelist_params.empty?
default_params.merge(request.params).reject { |k, _v| blacklist_params.include?(k.to_s) }
default_params.merge(request.params).reject { |k, _v| blacklist_params.map(&:to_s).include?(k.to_s) }
else
default_params.merge(request.params).select { |k, _v| whitelist_params.include?(k.to_s) }
default_params.merge(request.params).select { |k, _v| whitelist_params.map(&:to_s).include?(k.to_s) }
end.map { |k, v| [k.to_s.dup.force_encoding('UTF-8'), v.dup.to_s.force_encoding('UTF-8')] }
else
nil
Expand Down

0 comments on commit 21d1534

Please sign in to comment.