Skip to content

Instantly share code, notes, and snippets.

@radar
Created January 10, 2011 00:32
Show Gist options
  • Save radar/772181 to your computer and use it in GitHub Desktop.
Save radar/772181 to your computer and use it in GitHub Desktop.
yours: current_user.projects.inject(0){|sum,p| sum+= (p.users.count-1); sum}
mine: current_user.projects.to_a.sum { |p| p.users.count -1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment