diff options
author | Sean McGivern <sean@gitlab.com> | 2017-07-11 15:19:43 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-07-19 12:21:18 +0300 |
commit | c57ae83dcfaeff9c358b5f896202e04a86ad6ef3 (patch) | |
tree | 183f7f8c2b37a760964afcb939f1db9cd20c59f8 /app/finders/issuable_finder.rb | |
parent | 11f9ac0a48b62cef25eedede4c1819964f08d5ce (diff) |
Fix issuable state counter cache keys
These cache a hash of counts by state, so the state isn't needed in the key
itself.
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r-- | app/finders/issuable_finder.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 2e5a6493134..1585c11ab3a 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -20,7 +20,7 @@ # class IssuableFinder include CreatedAtFilter - + NONE = '0'.freeze IRRELEVANT_PARAMS_FOR_CACHE_KEY = %i[utf8 sort page].freeze @@ -89,8 +89,8 @@ class IssuableFinder execute.find_by!(*params) end - def state_counter_cache_key(state) - Digest::SHA1.hexdigest(state_counter_cache_key_components(state).flatten.join('-')) + def state_counter_cache_key + Digest::SHA1.hexdigest(state_counter_cache_key_components.flatten.join('-')) end def group @@ -417,9 +417,8 @@ class IssuableFinder params[:scope] == 'created-by-me' || params[:scope] == 'authored' || params[:scope] == 'assigned-to-me' end - def state_counter_cache_key_components(state) + def state_counter_cache_key_components opts = params.with_indifferent_access - opts[:state] = state opts.except!(*IRRELEVANT_PARAMS_FOR_CACHE_KEY) opts.delete_if { |_, value| value.blank? } |