rails:freeze:gems | freezzo.com

December 27, 2007

Rails error: syntax error, unexpected tINTEGER Object::1

Filed under: Ruby on Rails — Tags: , , , , — Randy @ 11:28 am

When trying to do a model.find(), I ran into the error, ’syntax error, unexpected tINTEGER Object::1′. If you have a table that uses a magic or reserved name, such as type, you will get this error. This error was a pain in the ass, but I figured out that you can get by it:

class SomeModel < ActiveRecord::Base
    self.inheritance_column = ''
end

The inheritance_column override is the key, basically giving it a different value to use. Hope this helps!

Powered by WordPress