chore(procedure): log dossiers before reset
This commit is contained in:
parent
a6cbd77ad3
commit
f485f144fc
1 changed files with 5 additions and 2 deletions
|
@ -403,9 +403,12 @@ class Procedure < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset!
|
def reset!
|
||||||
return false
|
|
||||||
if !locked? || draft_changed?
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue