Sha256: 9cdb7def11bfa04f7ce71a1972c00d901eb7d4b116b5f3a723a55d3e2fae2249
Contents?: true
Size: 372 Bytes
Versions: 38
Compression:
Stored size: 372 Bytes
Contents
module ActiveModel module Type class Boolean < Value # :nodoc: FALSE_VALUES = [false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF'].to_set def type :boolean end private def cast_value(value) if value == '' nil else !FALSE_VALUES.include?(value) end end end end end
Version data entries
38 entries across 37 versions & 5 rubygems