class ActiveModel::Type::Boolean

Active Model Boolean Type

A class that behaves like a boolean type, including rules for coercion of user input.

Constants

FALSE_VALUES

Private Instance Methods

cast_value(value) click to toggle source
# File lib/active_model/type/boolean.rb, line 39
def cast_value(value)
  if value == ""
    nil
  else
    !FALSE_VALUES.include?(value)
  end
end