Add changed? and compare on ProcedureRevision

This commit is contained in:
Paul Chavard 2021-01-20 13:21:23 +01:00
parent 15e9013264
commit 0d25f52309
3 changed files with 131 additions and 0 deletions

View file

@ -333,6 +333,14 @@ class Procedure < ApplicationRecord
publiee? || close? || depubliee?
end
def draft_changed?
publiee? && published_revision.changed?(draft_revision)
end
def revision_changes
published_revision.compare(draft_revision)
end
def accepts_new_dossiers?
publiee? || brouillon?
end