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:
authorMatija Čupić <matteeyah@gmail.com>2018-05-10 13:41:09 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-05-10 13:41:09 +0300
commit8d49ec681ffe4638f4db3311879448958d34c6f3 (patch)
tree6413490cf1cadd93d6b9e6aab4aaa6fffc29fa33 /app/models/concerns/redis_cacheable.rb
parent4fd77b33186e72824861367962c524e023138aff (diff)
Use symbol instead of string in RedisCacheable attribute definitions
Diffstat (limited to 'app/models/concerns/redis_cacheable.rb')
-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