While playing with Rails and ActiveRecord with has_many :through associations found an interesting error
> Account.find :all SyntaxError: compile error /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1748: syntax error, unexpected tINTEGER
It took me some time to figure this out so I thought it might be useful to post it here, maybe someone has the same problem.
The error is because of the ‘type’ attribute of Account model, in Rails it is reserved for single table inheritance. To fix this just do not use an attribute called ‘type’, rename it to something else.