This commit is contained in:
kara Diaby 2021-02-28 22:20:24 +01:00
parent 328c2a8e3c
commit 81f5a5254b
16 changed files with 544 additions and 674 deletions

View file

@ -3,11 +3,11 @@ module DossierLinkHelper
if user.is_a?(Instructeur)
if user.groupe_instructeurs.include?(dossier.groupe_instructeur)
instructeur_dossier_path(dossier.procedure, dossier)
else
avis = dossier.avis.find_by(instructeur: user)
if avis.present?
instructeur_avis_path(avis.procedure, avis)
end
end
elsif user.is_a?(Expert)
avis = dossier.avis.find_by(expert: user.user)
if avis.present?
expert_avis_path(avis.procedure, avis)
end
elsif user.owns_or_invite?(dossier)
dossier_path(dossier)