Disable Messagerie in archived Dossiers and procedures

* Use the existing Dossier#messagerie_available? method
* Raise when attempting to build a Commentaire if not messagerie_available?
* Disable the Messagerie form if not messagerie_available?
* Add tests :)
* Tweak the Horaires formatting while we’re here.
This commit is contained in:
Nicolas Bouilleaud 2019-06-20 09:58:53 +02:00
parent 8febe8c21f
commit bd47bf2691
8 changed files with 58 additions and 5 deletions

View file

@ -177,7 +177,7 @@ class Dossier < ApplicationRecord
end
def messagerie_available?
!brouillon? && !archived
!brouillon? && !archived && !procedure.archivee?
end
def retention_end_date