[eluser]taewoo[/eluser]
Hi everyone.
I am writing a standard user-to-user messaging application.
So every time someone sends or receives a message from another user, I'd have to query the USERS table to get their username, first name, last name, picture, etc.
To make it more efficient, I was thinking of doing something like (in pseudo-code):
Code:
select USER_NAME, FIRST_NAME, LAST_NAME, PICTURE from USERS where USERS.id IN ((select ID from senders) UNION (SELECT ID from recipients));
Is there a way to do this w/Active Record or do I need to spell it out w/raw SQL? Particularly the "in" comparison operator... is there a documentation for this?