Rails: NoMethodError (undefined method `type_cast_code' for nil:NilClass)

on under asbach
1 minute read

Out Of Date Warning

This article was published on 10/10/2011, this means the content may be out of date or no longer relevant.
You should verify that the technical information in this article is still up to date before relying upon it for your own purposes.

This Error:

NoMethodError (undefined method `type_cast_code’ for nil:NilClass):
  occured in activerecord-3.1.1/lib/active_record/attribute_methods/read.rb
  • Reason: tried to use a created_at column, that is nil
  • Solution: remove t.timestamps from table migration

Reposted from notes.it-jobs-und-stellen.de