Displaying 1 result from an estimated 1 matches for "to_user_id".
Did you mean:
tbluser_id
2012 Feb 14
2
Model with 2 foreign keys
Hi All,
I''d like to integrate a simple user-oriented messaging system into my
app.
I have a Message model, with :from_user_id, and :to_user_id (for the
user that sent and the user that recieved the message).
Obivously, (User) has_many :messages will fetch the messages that a
certain user has created, but not the ones that they have been sent.
Currently, I have this:
has_many :messages, :foreign_key=>:to_user_id
has_many :sent_message...