mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
8 lines
265 B
Ruby
8 lines
265 B
Ruby
class UserVisit < ActiveRecord::Base
|
|
attr_accessible :visited_at, :user_id
|
|
|
|
# A list of visits in the last month by day
|
|
def self.by_day(sinceDaysAgo=30)
|
|
where("visited_at >= ?", sinceDaysAgo.days.ago).group(:visited_at).order(:visited_at).count
|
|
end
|
|
end
|