I sure this has been asked a million times already. I just not searching very well. I have the following setup: I have an Instructor who has many Events. Each event has only one Instructor (owner/creator). I want to add a separate linkage to allow other instructors to be associated but still preserve the original instructor (owner). I have a crude ASCII representation but I can't for the life of me figure out how to do that in a rails model.
,-------------------.
| other_instructors |
|-------------------|
| event_id |-------------.
,---------------| instructor_id | |
| `-------------------' |
| ,---------------------. |
`->>| instructor |<--. |
|---------------------| | ,------------. |
| name | | | event |<-'
| email | | |------------|
| office | | | title |
| phone | | | location |
| admin? | | | benefit |
| notify_recipient? | | | notes |
| new_user? | | | start_time |
| (acts_as_authentic) | | | end_time |
`---------------------' | | live_in? |
`---| instructor |
`------------'
@instructor.events = [... array of events ...]
@associated_events = [... array of events associated but not owned via other_instructors table ...]
@event.instructor = ... One Instructor ...
@event.other_instructors = [... array of other instructors ...]