I’m thinking this must be pretty straightforward, but I’m finding
myself kind of going in circles in trying to model a simple “private
I have two models: user and message
has many messages
has a sender (User)
has many recipients (Users)
I’m at a bit of a loss as to how best define the relationships that
occur in a message. I want two relationships to the User model. One
for the sender and another for the recipients.
I’ve looked at STI but that doesn’t seem to be the correct solution
since a given User can be both a sender and recipient simultaneously.
Polymorphism seems to be the way to go, but I’m not clear on what that
would look like in this case.
I’m feeling that I’m missing something really really obvious here.