Apply suggestion to lib/pleroma/notification.ex

This commit is contained in:
rinpatch 2019-09-04 10:14:15 +00:00
parent c2b6c1b089
commit 7c3838090f

View file

@ -116,7 +116,8 @@ def set_read_up_to(%{id: user_id} = _user, id) do
{_, notification_ids} = Repo.update_all(query, [])
from(n in Notification, where: n.id in ^notification_ids)
Notification
|> where([n], n.id in ^notification_ids)
|> join(:inner, [n], activity in assoc(n, :activity))
|> join(:left, [n, a], object in Object,
on: