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

10th October 2011 – 44 words

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