Im trying to standardize data stored in my database. In the sense that I want everything stored as strings. Whats the best way to convert all datatypes into strings in rails?
So if I have something like this in my database:
t.funny = no #(boolean)
if Im converting hundreds of these to strings in a loop, whats the best way to do this?
Thanks
monkey patches accepted? 🙂
here is one:
now in your model you can use
t.funny.to_sbmeant to string boolean
please note that non boolean values will be returned as is
See it in action here