notifications_for_procedure is now based on instructeur.groupe_instructeurs

This commit is contained in:
simon lehericey 2019-10-24 15:35:43 +02:00
parent d411bfddc8
commit 4febf1851f
2 changed files with 8 additions and 5 deletions

View file

@ -110,8 +110,10 @@ class Instructeur < ApplicationRecord
end
def notifications_for_procedure(procedure, scope)
procedure
.defaut_groupe_instructeur.dossiers
target_groupes = groupe_instructeurs.where(procedure: procedure)
Dossier
.where(groupe_instructeur: target_groupes)
.send(scope) # :en_cours or :termine or :not_archived (or any other Dossier scope)
.merge(followed_dossiers)
.with_notifications