Active Model Type Boolean¶ ↑
A class that behaves like a boolean type, including rules for coercion of user input.
Coercion¶ ↑
Values set from user input will first be coerced into the appropriate ruby type. Coercion behavior is roughly mapped to Ruby’s boolean semantics.
-
“false”, “f” , “0”,
0or any other value inFALSE_VALUESwill be coerced tofalse -
Empty strings are coerced to
nil -
All other values will be coerced to
true
Constants
| FALSE_VALUES | = | [ false, 0, "0", :"0", "f", :f, "F", :F, "false", :false, "FALSE", :FALSE, "off", :off, "OFF", :OFF, ].to_set.freeze |