Hi, Is it possible to set up a double relationship in a Rails scaffold?
For example, if I had a user model and a private message model, the pm table would need to keep track of both the sender and recipient.
Obviously, for a single relationship I would just do this:
ruby script/generate scaffold pm title:string content:string user:references
Is there a similar way to set up two relations?
Also, is there anyway to set up aliases for the relations?
So rather than saying:
@message.user
You can use something like:
@message.sender or @message.recipient
Any advice would be greatly appreciated.
Thanks.