Hi I have models (User and Meeting) like this:
== Schema Information
Table name: users
id :integer not null, primary key
name :string(255)
email :string(255)
created_at :datetime
updated_at :datetime
class User < ActiveRecord::Base
has_many :participations
has_many :meetings, :through => :participations
has_many :lectures, :class_name => “Meeting”
attr_accessible :name, :email
and:
== Schema Information
Table name: meetings
id :integer not null, primary key
starts_at :datetime
ends_at :datetime
title :string(255)
description :text
place :string(255)
tutor :string(255)
total_places :integer
google_event_id :string(255)
google_sync_status :string(255)
created_at :datetime
updated_at :datetime
class Meeting < ActiveRecord::Base
it allows tracking changes in models - see declaration of
validations
include ActiveModel::Dirty
has_many :participations
has_many :users, :through => :participations
belongs_to :tutor, :class_name => “User”, :foreign_key => “user_id”
and then I can find a tutor for a meeting but not the lectures for the
user. Should I make a migration containing:
add_column :meetings :references, :user_id (or tutor_id) ???
Will appreciate any suggestions
Cheers