Hi everyone,
I have a model like the following
User.id
Friends
invited (fk to user)
inviter (fk to user)
Now, what I would like to do is given a uid, retrieve all the users
related to the inviter. So a retarded way of oding hti sis..
friendRequests = Friend.find(:all, :conditions => {:invited_id =>
uid})
Then iterate through the friend requests, grabbing each user object..
I know there is a better way of doing this in one query.. can I have
some direction on doing this?
thanks!
-dan
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.