Skip to content

Instantly share code, notes, and snippets.

@jimneath
Created May 31, 2013 08:49
Show Gist options
  • Save jimneath/5683686 to your computer and use it in GitHub Desktop.
Save jimneath/5683686 to your computer and use it in GitHub Desktop.
@data = @competition.entries.
select('gender, COUNT(gender) AS count').
group('gender')
# I want the following:
#
# => [{ gender: 'female', count: 635 }, { gender: 'male', count: 432 }]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment