chore(procedure): log dossiers before reset

This commit is contained in:
Paul Chavard 2023-05-15 10:21:54 +02:00
parent a6cbd77ad3
commit f485f144fc

View file

@ -403,9 +403,12 @@ class Procedure < ApplicationRecord
end
def reset!
return false
if !locked? || draft_changed?
draft_revision.dossiers.destroy_all
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
end
end
end