22 Feb 2007, 12:17am
/dev/rails
by

7 comments

Unexpected “parse error, unexpected tINTEGER Object” Error

Tonight I got this error when executing a .find( :all ) on a seemingly innocuous database table:

compile error
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1359: parse error, unexpected tINTEGER Object::3

After a bit of bashing about I figured out that this was because I’d named one of the fields in the table as type.

The moral of the story: don’t name table fields type or Rails will puke on you. So, are there other not-recommended field names?