User Visits count for 30 days ago was always 0

This commit is contained in:
Neil Lalonde 2013-04-02 15:03:23 -04:00
parent b6a6581b3c
commit 202addb693
1 changed files with 1 additions and 1 deletions

View File

@ -3,6 +3,6 @@ class UserVisit < ActiveRecord::Base
# A list of visits in the last month by day # A list of visits in the last month by day
def self.by_day(since=30.days.ago) def self.by_day(since=30.days.ago)
where("visited_at > ?", since).group(:visited_at).order(:visited_at).count where("visited_at >= ?", since).group(:visited_at).order(:visited_at).count
end end
end end