Andrew Vit wrote: > I've had to do this in a few places over the years myself: > ... Andrew Vit, you can use **`wannabe_bool`** gem: https://github.com/prodis/wannabe_boolprodis (Fernando Hamasaki de Amorim)
The idea of ***to_b*** method is inspired in Rails and Swift: * ActiveRecord::Type:Boolean in Rails: https://github.com/rails/rails/blob/fc4084fc5bdf60c46824094f4d6a362304c047f6/activerecord/lib/active_record/type/boolean.rb#L10 htt...prodis (Fernando Hamasaki de Amorim)
New ***to_b*** method converts **strings**, **symbols**, **numbers** and **nil** values in a **boolean** value. ***to_b*** method is available on ***String***, ***Symbol***, ***Numeric***, ***TrueClass***, ***FalseClass*** and ***NilC...prodis (Fernando Hamasaki de Amorim)