summaryrefslogtreecommitdiff
path: root/app/models/concerns/cacheable_attributes.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-09-20 12:32:54 -0700
committerMichael Kozono <mkozono@gmail.com>2018-09-24 12:11:26 -0700
commitf107bc69e34f79ea8faaa154caefe56948b8dd68 (patch)
tree60e65bdf6fd939d3d15113fd1f7a53c12038e5dc /app/models/concerns/cacheable_attributes.rb
parent45cf64c827270d66a88d483bb3f9043a90301255 (diff)
downloadgitlab-ce-f107bc69e34f79ea8faaa154caefe56948b8dd68.tar.gz
Simplify by using Gitlab::SafeRequestStore
These are clear wins.
Diffstat (limited to 'app/models/concerns/cacheable_attributes.rb')
-rw-r--r--app/models/concerns/cacheable_attributes.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/concerns/cacheable_attributes.rb b/app/models/concerns/cacheable_attributes.rb
index 62b78c3611c..f8034be8376 100644
--- a/app/models/concerns/cacheable_attributes.rb
+++ b/app/models/concerns/cacheable_attributes.rb
@@ -27,11 +27,7 @@ module CacheableAttributes
end
def cached
- if RequestStore.active?
- RequestStore[:"#{name}_cached_attributes"] ||= retrieve_from_cache
- else
- retrieve_from_cache
- end
+ Gitlab::SafeRequestStore[:"#{name}_cached_attributes"] ||= retrieve_from_cache
end
def retrieve_from_cache