summaryrefslogtreecommitdiff
path: root/lib/gitlab/cache
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-11-17 20:27:16 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-11-18 01:01:53 +0800
commit9ac0c76b78cd04b2505924f003dd720a0f155959 (patch)
tree67af1f0be0b9d6b5fc42b27c5afe5516e2c7574c /lib/gitlab/cache
parent0af35d7e30e373b885bfddb30b14718d72d75ab0 (diff)
downloadgitlab-ce-9ac0c76b78cd04b2505924f003dd720a0f155959.tar.gz
Use StrongMemoize and enable/disable cops properly
Diffstat (limited to 'lib/gitlab/cache')
-rw-r--r--lib/gitlab/cache/request_cache.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/cache/request_cache.rb b/lib/gitlab/cache/request_cache.rb
index 65e3e672894..ecc85f847d4 100644
--- a/lib/gitlab/cache/request_cache.rb
+++ b/lib/gitlab/cache/request_cache.rb
@@ -45,12 +45,13 @@ module Gitlab
klass.prepend(extension)
end
- # rubocop:disable Cop/ModuleWithInstanceVariables
+ attr_accessor :request_cache_key_block
+
def request_cache_key(&block)
if block_given?
- @request_cache_key = block
+ self.request_cache_key_block = block
else
- @request_cache_key
+ request_cache_key_block
end
end