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-17 02:12:37 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-05-17 02:12:37 +0300
commit51f5ee33c448ee8a157ad12dac80482a11a7c72f (patch)
tree41022d1b679a9849c314a5f4578a2c8817846740 /app/models/concerns/redis_cacheable.rb
parenteeb955a66d2410d7117737ecd1b33b0cfe67327b (diff)
Use Gitlab.rails5? for checking if on rails5
Diffstat (limited to 'app/models/concerns/redis_cacheable.rb')
-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