Hello, I''m trying to create a Rails like embedded request like that (it is working, I''m selecting projects ordered by number of contributors) : SELECT projects.id AS id, project_topic, (SELECT count(*) FROM project_users WHERE projects.id project_users.project_id) AS contributors FROM projects ORDER BY contributors DESC I didn''t find any resource to create it in a Rails way : Projects.find(..., :order => ''contributors'') and do a sub-request somewhere. Is there anyone who could give me some links or help? Thanks ! Vincent -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---