summaryrefslogtreecommitdiff
path: root/app/models/service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/service.rb')
-rw-r--r--app/models/service.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/service.rb b/app/models/service.rb
index 831c2ea1141..1d259bcfec7 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -206,10 +206,11 @@ class Service < ActiveRecord::Base
args.each do |arg|
class_eval %{
def #{arg}?
+ # '!!' is used because nil or empty string is converted to nil
if Gitlab.rails5?
- !ActiveModel::Type::Boolean::FALSE_VALUES.include?(#{arg})
+ !!ActiveRecord::Type::Boolean.new.cast(#{arg})
else
- ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(#{arg})
+ !!ActiveRecord::Type::Boolean.new.type_cast_from_database(#{arg})
end
end
}