tech(refactor): extract clone logic inside its own class

This commit is contained in:
Martin 2024-02-07 17:29:47 +01:00
parent 72a3f6e89c
commit 3e64a3bbbc
7 changed files with 34 additions and 33 deletions

View file

@ -497,7 +497,7 @@ class Procedure < ApplicationRecord
}
include_list[:groupe_instructeurs] = [:instructeurs, :contact_information] if !is_different_admin
procedure = self.deep_clone(include: include_list) do |original, kopy|
PiecesJustificativesService.clone_attachments(original, kopy)
ClonePiecesJustificativesService.clone_attachments(original, kopy)
end
procedure.path = SecureRandom.uuid
procedure.aasm_state = :brouillon