Sascha
You need to collect all the ids of the friends and use that as a filter.
:with => { :id => current_user.friend_ids }
should work, assuming you have something like this in your model:
has_many :friends, :through => :friendships, :class_name => "User"
Sean
Sascha wrote:
> Hi,
>
> I have been using TS with great success so far. I want to extend the
> searching capabilities my application provides and also allow users to
> only search their friends' records.
>
> I have a users table and a friendships table with a user_id and
> friend_id. All the rails associations are set up.
>
> How would I do a search on only my friends records? A user will maybe
> have about 100 friends on average.
>
> Many Thanks,
> Sascha
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" 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/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---