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 [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
-~----------~----~----~----~------~----~------~--~---