Commit 1917d53b authored by Sean McGivern's avatar Sean McGivern

Merge branch 'blackst0ne-rails5-replace-true-values-with-false-values' into 'master'

[Rails5] Add FALSE_VALUES constant to Service#boolean_accessor

See merge request gitlab-org/gitlab-ce!18240
parents e7ddb40c 432e57fc
...@@ -206,8 +206,12 @@ class Service < ActiveRecord::Base ...@@ -206,8 +206,12 @@ class Service < ActiveRecord::Base
args.each do |arg| args.each do |arg|
class_eval %{ class_eval %{
def #{arg}? def #{arg}?
if Gitlab.rails5?
!ActiveModel::Type::Boolean::FALSE_VALUES.include?(#{arg})
else
ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(#{arg}) ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(#{arg})
end end
end
} }
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment