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
This commit is contained in:
Sean McGivern 2018-04-09 07:57:37 +00:00
commit 1917d53b22

View file

@ -206,7 +206,11 @@ class Service < ActiveRecord::Base
args.each do |arg|
class_eval %{
def #{arg}?
ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(#{arg})
if Gitlab.rails5?
!ActiveModel::Type::Boolean::FALSE_VALUES.include?(#{arg})
else
ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(#{arg})
end
end
}
end