Here’s a seemingly simple ActiveRecord use case. I have Projects and
Users. Each project has a single team leader as well as a review team
that consists of several users. I would like to use the same User
model for authentication and just reference these users in my Project
I tried this but got an “unknown column” error (for User.project_id)
has_one :lead, :class_name => ‘User’
Any suggestions on how to model this relationship without requiring
references to Project in the User table?
From a database table viewpoint I would like
create_table :projects do |t| t.integer :lead_id t.timestamps end
The review team part seems like it could be done with HBTM.