linked_dossiers_for should include dossiers_from_avis

This commit is contained in:
Paul Chavard 2020-02-11 17:30:21 +01:00
parent 5d0a8b567f
commit 0d55743d9f

View file

@ -589,7 +589,8 @@ class Dossier < ApplicationRecord
end
def linked_dossiers_for(instructeur)
instructeur.dossiers.where(id: champs.filter(&:dossier_link?).map(&:value).compact)
dossier_ids = champs.filter(&:dossier_link?).map(&:value).compact
(instructeur.dossiers.where(id: dossier_ids) + instructeur.dossiers_from_avis.where(id: dossier_ids)).uniq
end
def hash_for_deletion_mail