From 51f5ee33c448ee8a157ad12dac80482a11a7c72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Thu, 17 May 2018 01:12:37 +0200 Subject: Use Gitlab.rails5? for checking if on rails5 --- app/models/concerns/redis_cacheable.rb | 6 +++--- 1 file 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 -- cgit v1.2.1