Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-29 17:55:55 +0300
committerRémy Coutable <remy@rymai.me>2016-09-30 13:02:54 +0300
commit56259155d5a0ecfbbafb7319651495582504cfb8 (patch)
tree311bc67de01c68e896d0a608c3c9fdbc85d77b9d /app/helpers
parent383dafdf31adaded392664cba9ba8b7262505dc6 (diff)
Small improvements thanks to Robert's feedback
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/issuables_helper.rb8
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