mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Add bookmarks and favorites to dashboard stats
This commit is contained in:
@ -583,6 +583,10 @@ class Topic < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def self.starred_counts_per_day(sinceDaysAgo=30)
|
||||
TopicUser.where('starred_at > ?', sinceDaysAgo.days.ago).group('date(starred_at)').order('date(starred_at)').count
|
||||
end
|
||||
|
||||
# Enable/disable the mute on the topic
|
||||
def toggle_mute(user, muted)
|
||||
TopicUser.change(user, self.id, notification_level: muted?(user) ? TopicUser.notification_levels[:regular] : TopicUser.notification_levels[:muted] )
|
||||
|
Reference in New Issue
Block a user