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

@ -288,7 +288,7 @@ class Dossier < ApplicationRecord
scope :for_procedure, -> (procedure) { includes(:user, :groupe_instructeur).where(groupe_instructeurs: { procedure: procedure }) }
scope :for_api_v2, -> { includes(procedure: [:administrateurs], etablissement: [], individual: [], traitements: []) }
scope :with_notifications, -> (instructeur) do
scope :with_notifications, -> do
joins(:follows)
.where('last_champ_updated_at > follows.demande_seen_at' \
' OR groupe_instructeur_updated_at > follows.demande_seen_at' \