Today I discovered a very nice little gem, it´s called wannabe_bool and it is very useful. It handles cases where for example the string "true" is converted to a simple true boolean.
If string, integer, symbol and nil values wanna be a boolean value, they can with the new to_b method from wannabe_bool. Moreover, you can use WannabeBool::Attributes module to create predicate methods in your classes.
More about this very convenient script can be found on github: https://github.com/prodis/wannabe_bool
I know you can also code this stuff by yourself, but why you should reinvent the wheel? This gem is tested and seems to work perfect.
Have a good one ;-)