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-16 22:36:20 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-05-16 22:36:20 +0300
commita4b0876b391f0717365cabd78cf9715b64649797 (patch)
tree2d4e20014c2202348ba17639408c96e3ccc8c202 /spec/models
parent42ab6f8557505595f86604735d8805f879247da8 (diff)
Add attribute check in cached getter
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/concerns/redis_cacheable_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/models/concerns/redis_cacheable_spec.rb b/spec/models/concerns/redis_cacheable_spec.rb
index 827629c3180..2da0f33e27b 100644
--- a/spec/models/concerns/redis_cacheable_spec.rb
+++ b/spec/models/concerns/redis_cacheable_spec.rb
@@ -10,6 +10,10 @@ describe RedisCacheable do
def cast_value_from_cache(attribute, cached_value)
cached_value
end
+
+ def has_attribute?(attribute)
+ attributes.has_key?(attribute)
+ end
end
end