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!
Tags: object, rails, ruby, tinteger, unexpected

June 18th, 2008 at 2:18 am
It helped to find a bug, thanks a bunch!
June 18th, 2008 at 3:41 pm
You are my hero! Exactly what I need: “type” as column name was the problem!
thx a lot!
July 30th, 2008 at 5:35 pm
Thank you. I was going crazy with this.
August 16th, 2008 at 6:39 am
Your blog is interesting!
Keep up the good work!
October 20th, 2008 at 10:53 am
Thanks a lot!