How do I do a has_many through association on a has_many through association in rails?
Posted
by Angela
on Stack Overflow
See other posts from Stack Overflow
or by Angela
Published on 2010-04-22T02:51:45Z
Indexed on
2010/04/22
4:43 UTC
Read the original article
Hit count: 168
has-many-through
Warning: I may have the wrong 'problem statement' but here it goes:
A Campaign has many Contacts.
A Campaign has many Emails.
Therefore, a Contact has many Emails through a Campaign.
And an Email can have many Contacts through a Campaign.
Each Contact-Email pair has its own unique Status (status1, status2, etc).
Each Status (for a Contact-Email pair) will have its own User.
I do not know how to model Status, or User. Currently the immediate challenge is Status.
(see diagram below)
© Stack Overflow or respective owner