One of recent refactorings blow up read_attribute_before_type_case in AR

Could someone have a look at this regression fixing patch?

http://dev.rubyonrails.org/ticket/11165