Rails: complex HABTM relationship with 3 keys?

Has_many :through allows you use to use a proper join model, instead of an implied on like habtm You would make a whole class called something like MeetingAttendance where you would store the meeting and who attended. Then you can put whatever attributes on the model you want, including position Then simply Person has_many :meeting_attendances Person has_many :meetings, :through => :meeting_attendances Meeting has_many :meeting_attendances Meeting has_many :people, :through => :meeting_attendances and class MeetingAttendance.

Has_many :through allows you use to use a proper join model, instead of an implied on like habtm. You would make a whole class called something like MeetingAttendance, where you would store the meeting and who attended. Then you can put whatever attributes on the model you want, including position.

Then simply Person has_many :meeting_attendances Person has_many :meetings, :through => :meeting_attendances Meeting has_many :meeting_attendances Meeting has_many :people, :through => :meeting_attendances and class MeetingAttendance.

I'm trying to determine how many meeting hours a particular Organization has, but it's not as easy as it seems it should be because of certain relationship complexities. Because People may change positions (and Organizations) over time, when someone attends a meeting, I need to also make note of their position at that time in order for the tally to be accurate. As it currently stands, because the HATBM join table is handled implicitly (meetings_people), I can't track position.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions