# Annoying rails error!

**URL:** <https://www.ruby-forum.com/t/annoying-rails-error/88545>\
**Category:** Rails\
**Created:** [March 12, 2007, 3:38pm UTC](https://www.ruby-forum.com/t/annoying-rails-error/88545 "2007-03-12T15:38:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [March 12, 2007, 3:38pm UTC](https://www.ruby-forum.com/t/annoying-rails-error/88545/1 "2007-03-12T15:38:04Z")

</div>

OK, I got the relationship side of things sorted out for my rails  
application!

class User \< ActiveRecord::Base  
has\_many :userevents  
has\_many :events, :through =\> :userevents

class Event \< ActiveRecord::Base  
has\_many :userevents  
has\_many :users, :through =\> :userevents

class Userevent \< ActiveRecord::Base  
belongs\_to :user  
belongs\_to :event

When I want to see what events a user belongs to, surely the following  
should work:

Now, calling @user = User.find(params[:id]).events

but not the case, it returns the following error:

compile error  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active\_record/base.rb:1359:  
parse error, unexpected tINTEGER  
Object::1  
^

A google search gives something about using reserved words in my  
database table but (for the time being) the only columns that exist are  
id, user\_id and event\_id.

I’m going crazy!

Cheers  
Mike

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [March 12, 2007, 4:39pm UTC](https://www.ruby-forum.com/t/annoying-rails-error/88545/2 "2007-03-12T16:39:58Z")

</div>

On 3/12/07, Mike [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Object::1  
> ^

You have a type column in your database table. This is reserved for  
single-table inheritance. Rename it.

jeremy

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [March 12, 2007, 9:25pm UTC](https://www.ruby-forum.com/t/annoying-rails-error/88545/3 "2007-03-12T21:25:40Z")

</div>

Jeremy K. wrote:

> On 3/12/07, Mike [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Object::1  
> > ^
> 
> You have a type column in your database table. This is reserved for  
> single-table inheritance. Rename it.
> 
> jeremy

yep - found it, thanks for the help!
