diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-29 16:55:55 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-30 12:02:54 +0200 |
commit | 56259155d5a0ecfbbafb7319651495582504cfb8 (patch) | |
tree | 311bc67de01c68e896d0a608c3c9fdbc85d77b9d /app/helpers/issuables_helper.rb | |
parent | 383dafdf31adaded392664cba9ba8b7262505dc6 (diff) | |
download | gitlab-ce-56259155d5a0ecfbbafb7319651495582504cfb8.tar.gz |
Small improvements thanks to Robert's feedback
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/helpers/issuables_helper.rb')
-rw-r--r-- | app/helpers/issuables_helper.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 8aa1ece017c..8c04200fab9 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -137,13 +137,13 @@ module IssuablesHelper issuables_finder.execute.page(1).total_count end - IRRELEVANT_PARAMS_FOR_CACHE_KEY = %w[utf8 sort page] + IRRELEVANT_PARAMS_FOR_CACHE_KEY = %i[utf8 sort page] private_constant :IRRELEVANT_PARAMS_FOR_CACHE_KEY def issuables_state_counter_cache_key(issuable_type, state) - opts = params.dup - opts['state'] = state - opts.delete_if { |k, v| IRRELEVANT_PARAMS_FOR_CACHE_KEY.include?(k) } + opts = params.with_indifferent_access + opts[:state] = state + opts.except!(*IRRELEVANT_PARAMS_FOR_CACHE_KEY) hexdigest(['issuables_count', issuable_type, opts.sort].flatten.join('-')) end |