Grayson Piercee wrote:

> User.find(:all, :conditions => ["interests in
> (?)",current_user.interests)

Here's a wild guess. I hope someone else corrects it if I have lead you astray!

User.find(:all, :include => :interests,
   :conditions => ["interests.id IN (?)",current_user.interests]
   :order => 'COUNT(interests.id) DESC')

(At work we have taken to putting all raw SQL commands in ALL CAPS...)


--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to