Sha256: 26562729921cffa2383b0b42121234d012cdb395f480c301e3cf799d1ffd1f61
Contents?: true
Size: 948 Bytes
Versions: 33
Compression:
Stored size: 948 Bytes
Contents
module ActiveRecord module Type class Boolean < Value # :nodoc: def type :boolean end private def cast_value(value) if value == '' nil elsif ConnectionAdapters::Column::TRUE_VALUES.include?(value) true else if !ConnectionAdapters::Column::FALSE_VALUES.include?(value) ActiveSupport::Deprecation.warn(<<-MSG.squish) You attempted to assign a value which is not explicitly `true` or `false` (#{value.inspect}) to a boolean column. Currently this value casts to `false`. This will change to match Ruby's semantics, and will cast to `true` in Rails 5. If you would like to maintain the current behavior, you should explicitly handle the values you would like cast to `false`. MSG end false end end end end end
Version data entries
33 entries across 33 versions & 6 rubygems