diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-05-16 22:36:20 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-05-16 22:36:20 +0300 |
commit | a4b0876b391f0717365cabd78cf9715b64649797 (patch) | |
tree | 2d4e20014c2202348ba17639408c96e3ccc8c202 /spec/models/concerns | |
parent | 42ab6f8557505595f86604735d8805f879247da8 (diff) |
Add attribute check in cached getter
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/redis_cacheable_spec.rb | 4 |
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 |