59 points · by phsr · 14y ago · 10 comments
In AR 4.0, you can have ActiveRecord automatically cast them to a different type.
https://github.com/rails/rails/pull/4775
Take a look at @tenderlove's comment down below about the actual implementation (as opposed to my crappy one in the issue body).