From 733b8bd904318a301c752f449ac1402bafcd1532 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 22 Jul 2020 11:27:49 +0200 Subject: [PATCH] Add published revision to all non brouillon procedures --- app/services/revisions_migration.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/services/revisions_migration.rb b/app/services/revisions_migration.rb index 8a9f5d89c..df8f4c5b1 100644 --- a/app/services/revisions_migration.rb +++ b/app/services/revisions_migration.rb @@ -10,15 +10,12 @@ class RevisionsMigration add_types_de_champs_to_revision(procedure, :types_de_champ) add_types_de_champs_to_revision(procedure, :types_de_champ_private) - if procedure.publiee? + if !procedure.brouillon? published_revision = procedure.draft_revision procedure.draft_revision = procedure.create_new_revision procedure.published_revision = published_revision procedure.save!(validate: false) - elsif procedure.close? || procedure.depubliee? - procedure.draft_revision = procedure.create_new_revision - procedure.save!(validate: false) end true