mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Wire up the dimiss button in the new notifications menu (#17745)
This commit is a subset of the changes proposed in https://github.com/discourse/discourse/pull/17379.
This commit is contained in:
@@ -148,6 +148,12 @@ class Notification < ActiveRecord::Base
|
||||
.update_all(read: true)
|
||||
end
|
||||
|
||||
def self.read_types(user, types = nil)
|
||||
query = Notification.where(user_id: user.id, read: false)
|
||||
query = query.where(notification_type: types) if types
|
||||
query.update_all(read: true)
|
||||
end
|
||||
|
||||
def self.interesting_after(min_date)
|
||||
result = where("created_at > ?", min_date)
|
||||
.includes(:topic)
|
||||
|
Reference in New Issue
Block a user