refactor Dossier#with_notifications

This commit is contained in:
clemkeirua 2020-09-18 15:40:26 +02:00 committed by Keirua (Rebase PR Action)
parent d01a53eb72
commit f96377d878
6 changed files with 15 additions and 15 deletions

View file

@ -91,7 +91,7 @@ class ProcedurePresentation < ApplicationRecord
case table
when 'notifications'
dossiers_id_with_notification = dossiers.merge(instructeur.followed_dossiers).with_notifications(instructeur).ids
dossiers_id_with_notification = dossiers.merge(instructeur.followed_dossiers).with_notifications.ids
if order == 'desc'
return dossiers_id_with_notification +
(dossiers.order('dossiers.updated_at desc').ids - dossiers_id_with_notification)