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
on 2007-03-12 15:38
on 2007-03-12 16:39
On 3/12/07, Mike <firstname.lastname@example.org> wrote: > Object::1 > ^ You have a type column in your database table. This is reserved for single-table inheritance. Rename it. jeremy
on 2007-03-12 21:25
Jeremy Kemper wrote: > On 3/12/07, Mike <email@example.com> 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!