rails/rails — pull request #7035 by Empact (2012-07-11 23:09:54+00:00)
Title: Add #cast and #cast! to Relation.

These allow you to declare a mapping from generated column names to simplified
database column types (i.e. those used in migrations). This way scopes with
columns generated in their select lists can also include the information as to what
form that data takes. This saves the user from having to translate the data
from a sql string wherever it's used.

Currently passes on mysql, mysql2, and sqlite3. Postgres doesn't work due to some conflicts with the OID handling. Haven't checked the other adapters.

What do you guys think?