summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-05-10 12:41:09 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-05-10 12:41:09 +0200
commit8d49ec681ffe4638f4db3311879448958d34c6f3 (patch)
tree6413490cf1cadd93d6b9e6aab4aaa6fffc29fa33
parent4fd77b33186e72824861367962c524e023138aff (diff)
downloadgitlab-ce-8d49ec681ffe4638f4db3311879448958d34c6f3.tar.gz
Use symbol instead of string in RedisCacheable attribute definitions
-rw-r--r--app/models/concerns/redis_cacheable.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/redis_cacheable.rb b/app/models/concerns/redis_cacheable.rb
index 0dd15734eae..bc86bbe6525 100644
--- a/app/models/concerns/redis_cacheable.rb
+++ b/app/models/concerns/redis_cacheable.rb
@@ -7,7 +7,7 @@ module RedisCacheable
class_methods do
def cached_attr_reader(*attributes)
attributes.each do |attribute|
- define_method("#{attribute}") do
+ define_method(attribute) do
cached_attribute(attribute) || read_attribute(attribute)
end
end
@@ -15,7 +15,7 @@ module RedisCacheable
def cached_attr_time_reader(*attributes)
attributes.each do |attribute|
- define_method("#{attribute}") do
+ define_method(attribute) do
cached_value = cached_attribute(attribute)
cached_value ? Time.zone.parse(cached_value) : read_attribute(attribute)
end