dossier: add a messagerie_available? method

This commit is contained in:
Pierre de La Morinerie 2019-03-12 15:41:47 +01:00
parent ad57c6ef99
commit ce9c5da6e1
2 changed files with 5 additions and 1 deletions

View file

@ -170,6 +170,10 @@ class Dossier < ApplicationRecord
brouillon? || en_construction?
end
def messagerie_available?
!brouillon? && !archived
end
def retention_end_date
if instruction_commencee?
en_instruction_at + procedure.duree_conservation_dossiers_dans_ds.months

View file

@ -15,7 +15,7 @@
%li.footer-column
%h3.footer-header Poser une question sur votre dossier :
%p
- if dossier.present? && !dossier.brouillon?
- if dossier.present? && dossier.messagerie_available?
Directement
= link_to "par la messagerie", messagerie_dossier_path(dossier)
- else