class StrongerParameters::BooleanConstraint
Constants
- FALSE_VALUES
- TRUE_VALUES
Public Instance Methods
value(v)
click to toggle source
# File lib/stronger_parameters/constraints/boolean_constraint.rb, line 9 def value(v) return true if TRUE_VALUES.include?(v) return false if FALSE_VALUES.include?(v) InvalidValue.new(v, "must be either true or false") end