Merge pull request #9047 from tchak/feat-add-log-on-dossiers-reset

chore(procedure): log dossiers before reset
This commit is contained in:
Paul Chavard 2023-05-15 09:25:23 +00:00 committed by GitHub
commit b583fe1fab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -403,11 +403,14 @@ class Procedure < ApplicationRecord
end end
def reset! def reset!
return false
if !locked? || draft_changed? if !locked? || draft_changed?
dossier_ids_to_destroy = draft_revision.dossiers.ids
if dossier_ids_to_destroy.present?
Rails.logger.info("Resetting #{dossier_ids_to_destroy.size} dossiers on procedure #{id}: #{dossier_ids_to_destroy}")
draft_revision.dossiers.destroy_all draft_revision.dossiers.destroy_all
end end
end end
end
def suggested_path(administrateur) def suggested_path(administrateur)
if path_customized? if path_customized?