rails/rails — pull request #5661 by carlosantoniodasilva (2012-03-30 02:16:56+00:00)
Title: Typecast 'id' attribute in read_attribute when using custom pks

Related to [this awesome cleanup](https://github.com/rails/rails/commit/6cff09038d5d78e6a4a12d0a27c6b1b87f0a5147) :heart:.

When using custom primary keys, the `id` attribute works as an alias to the pk. But in case of read_attribute, when reading the `id` [it was not being typecasted after the change](http://travis-ci.org/#!/rails/rails/jobs/978068/L111).

Also added a deprecation message to `type_cast_code` according to the conversation in the same commit.

Thanks!