Skip to content

Instantly share code, notes, and snippets.

@mperham
Created March 25, 2010 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperham/343496 to your computer and use it in GitHub Desktop.
Save mperham/343496 to your computer and use it in GitHub Desktop.
# Don't query each rubygem version separately
rows = AR::Base.connection.select_rows "select count(*), version_id, date(created_at) from downloads group by version_id, date(created_at)"
rows.each do |(count, version_id, date)|
# do stuff
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment