summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-05-17 01:12:37 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-05-17 01:12:37 +0200
commit51f5ee33c448ee8a157ad12dac80482a11a7c72f (patch)
tree41022d1b679a9849c314a5f4578a2c8817846740
parenteeb955a66d2410d7117737ecd1b33b0cfe67327b (diff)
downloadgitlab-ce-51f5ee33c448ee8a157ad12dac80482a11a7c72f.tar.gz
Use Gitlab.rails5? for checking if on rails5
-rw-r--r--app/models/concerns/redis_cacheable.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/concerns/redis_cacheable.rb b/app/models/concerns/redis_cacheable.rb
index a8d96f63d7a..3d24f0dfdc1 100644
--- a/app/models/concerns/redis_cacheable.rb
+++ b/app/models/concerns/redis_cacheable.rb
@@ -45,10 +45,10 @@ module RedisCacheable
end
def cast_value_from_cache(attribute, value)
- if self.class.column_for_attribute(attribute).respond_to?(:type_cast_from_database)
- self.class.column_for_attribute(attribute).type_cast_from_database(value)
- else
+ if Gitlab.rails5?
self.class.type_for_attribute(attribute).cast(value)
+ else
+ self.class.column_for_attribute(attribute).type_cast_from_database(value)
end
end
end