I have a table defined as such:
Name - Order# - Widget Count Bob - 12311 - 6 Nancy- 12555 - 8 BoB - 87573 - 12 Nancy- 12929 - 4
I\'d
This should work, assuming your model is called Person:
Person.group(:name).count(:widget_count)
You can find more info about it on RailsGuides for ActiveRecord.