Created
October 17, 2010 21:55
-
-
Save nathany/631342 to your computer and use it in GitHub Desktop.
I'm sure glad I'm using an ORM!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope :ranked, select('rubygems.name, rubygem_id, | |
COUNT(distinct machine_id) as machine_count, | |
COUNT(distinct platform_id) as platform_count, | |
GROUP_CONCAT(version_list) as version_list'). | |
joins(:rubygem).group(:rubygem_id). | |
order('machine_count DESC, platform_count DESC, rubygems.name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kills self