lib/super_settings/coerce.rb in super_settings-2.0.1 vs lib/super_settings/coerce.rb in super_settings-2.0.2
- old
+ new
@@ -5,18 +5,14 @@
module SuperSettings
# Utility functions for coercing values to other data types.
class Coerce
# rubocop:disable Lint/BooleanSymbol
FALSE_VALUES = Set.new([
- false, 0,
"0", :"0",
"f", :f,
- "F", :F,
"false", :false,
- "FALSE", :FALSE,
- "off", :off,
- "OFF", :OFF
+ "off", :off
]).freeze
# rubocop:enable Lint/BooleanSymbol
class << self
# Cast variations of booleans (i.e. "true", "false", 1, 0, etc.) to actual boolean objects.
@@ -27,10 +23,10 @@
if value == false
false
elsif blank?(value)
nil
else
- !FALSE_VALUES.include?(value)
+ !FALSE_VALUES.include?(value.to_s.downcase)
end
end
# Cast a value to a Time object.
#