Fix for Rails 4.1, no type_cast_code