Know how I would do it? I'm googling for the answer but I don't what
keywords I should use.
[1.day.ago, 2.days.ago].inject({}) do |hash, days|
hash[days] = Team.count(:conditions => (days .. days + 1.day))
hash
end
Ruby can be a brain bender, and a lot of it is google-proof (gag derivative websites notwithstanding). You can't be expected to google for "inject", or "count_by", if those were indeed the correct "keywords" (actually "methods").
For some of this, you just gotta curl up with an old-fashioned paper book and read it, for a while, for all the details to soak in!