Guard for missing attestation on dossier
This commit is contained in:
parent
95f98fe605
commit
f5c80f211d
1 changed files with 4 additions and 1 deletions
|
@ -48,8 +48,11 @@ module Users
|
||||||
end
|
end
|
||||||
|
|
||||||
def attestation
|
def attestation
|
||||||
if dossier.attestation.pdf.attached?
|
if dossier.attestation&.pdf&.attached?
|
||||||
redirect_to url_for(dossier.attestation.pdf)
|
redirect_to url_for(dossier.attestation.pdf)
|
||||||
|
else
|
||||||
|
flash.notice = "L'attestation n'est plus disponible sur ce dossier."
|
||||||
|
redirect_to dossier_path(dossier)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue