Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
Try a fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed Aug 24, 2010
1 parent 5d582e5 commit 6451659
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/user_statistics.rb
Expand Up @@ -4,7 +4,7 @@ def self.signups_per_day(from = Date.today - 6, to = Date.today)
from, to = from.to_date, to.to_date
users = User.select("DATE(users.created_at) AS users_date, count(*) AS count_all").group("users_date")
users = users.having(["users_date > ? AND users_date < ?", from - 1, to + 1]).all
users = users.inject({}) { |a, c| a[Date.parse(c.users_date)] = c.count_all.to_i; a }
users = users.inject({}) { |a, c| a[c.users_date] = c.count_all.to_i; a }
results = ActiveSupport::OrderedHash.new
while from <= to
results[from] = users[from].to_i
Expand Down

0 comments on commit 6451659

Please sign in to comment.