mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: badge notifications are marked read by the system after opening
This commit is contained in:
parent
72a28aeb7c
commit
37af13f6ea
1 changed files with 5 additions and 1 deletions
|
@ -255,8 +255,12 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def saw_notification_id(notification_id)
|
||||
User.where(["id = ? and seen_notification_id < ?", id, notification_id])
|
||||
User.where("id = ? and seen_notification_id < ?", id, notification_id)
|
||||
.update_all ["seen_notification_id = ?", notification_id]
|
||||
|
||||
# mark all badge notifications read
|
||||
Notification.where('user_id = ? AND NOT read AND notification_type = ?', id, Notification.types[:granted_badge])
|
||||
.update_all ["read = ?", true]
|
||||
end
|
||||
|
||||
def publish_notifications_state
|
||||
|
|
Loading…
Reference in a new issue