[Rails5] Add FALSE_VALUES constant to Service#boolean_accessor
In Rails 5.0 the `ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES` constant has been removed [1] and the remaining `FALSE_VALUES` constant has been moved to `ActiveModel::Type::Boolean` [2] [1]:a502703c3d
[2]:9cc8c6f373
This commit is contained in:
parent
aade8b3652
commit
432e57fccf
|
@ -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 New Issue