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:
commit
1917d53b22
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue