mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-21 04:27:47 +01:00
now marking multiple "smiled" and "commented" notifications as read at once
This commit is contained in:
parent
1c0a70165a
commit
5c2d75ece9
1 changed files with 4 additions and 10 deletions
|
@ -9,16 +9,10 @@ class AnswerController < ApplicationController
|
|||
notif.new = false
|
||||
notif.save
|
||||
end
|
||||
notif = Notification.where(target_type: "Comment", target_id: @answer.comments.pluck(:id), recipient_id: current_user.id, new: true).first
|
||||
unless notif.nil?
|
||||
notif.new = false
|
||||
notif.save
|
||||
end
|
||||
notif = Notification.where(target_type: "Smile", target_id: @answer.smiles.pluck(:id), recipient_id: current_user.id, new: true).first
|
||||
unless notif.nil?
|
||||
notif.new = false
|
||||
notif.save
|
||||
end
|
||||
notif = Notification.where(target_type: "Comment", target_id: @answer.comments.pluck(:id), recipient_id: current_user.id, new: true)
|
||||
notif.update_all(new: false) unless notif.empty?
|
||||
notif = Notification.where(target_type: "Smile", target_id: @answer.smiles.pluck(:id), recipient_id: current_user.id, new: true)
|
||||
notif.update_all(new: false) unless notif.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue