I wanted to make a simple chart of users that have been created in the past month in my app. Like basically for each day in the past month I want to show the count of users
I think separation trumps the minimal performance gains here:
# Controller
@users = User.all(:conditions => ["created_at >= ?", Date.today.at_beginning_of_month])
# View
Date.today.at_beginning_of_month.upto(Date.today).each do |date|
<%= date %>: <%= @users.select{|u| u.created_at == date }.size %>
end