FIX: mark invite accepted notification as read

This commit is contained in:
Arpit Jalan 2015-08-13 11:09:58 +05:30
parent 181b04be7e
commit eb941475fa
1 changed files with 2 additions and 2 deletions

View File

@ -299,8 +299,8 @@ class User < ActiveRecord::Base
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])
# mark all "badge granted" and "invite accepted" notifications read
Notification.where('user_id = ? AND NOT read AND notification_type IN (?)', id, [Notification.types[:granted_badge], Notification.types[:invitee_accepted]])
.update_all ["read = ?", true]
end