I'm having a brain cramp this morning. Here's what I want to do. I want users
to log in, and then I want to use their log in name to track bugs they
report and the person a bug is assigned to. That implies that a single model
is associated with the same other model multiple times. Here's where the
brain cramp comes in: I forgot how.
class Bug < ActiveRecord::Base
belongs_to :reporter # this is a :user
belongs_to :assigned_to # this is a :user
The reporter and assigned_to associations have their own ids, reporter_id
and assigned_to_id. However, these ids refer to records in the users table.
I can create faux models Reporter and AssignedTo that do a set_table_name
:users, but that wrecks all validations and other goodness. Is inheritance
the right thing to do here?