refactor(active_storage): no download on clone

This commit is contained in:
Paul Chavard 2022-11-10 12:01:15 +00:00
parent b526fef4db
commit 95f65900d3
5 changed files with 30 additions and 49 deletions

View file

@ -488,10 +488,7 @@ class Procedure < ApplicationRecord
}
include_list[:groupe_instructeurs] = :instructeurs if !is_different_admin
procedure = self.deep_clone(include: include_list) do |original, kopy|
begin
PiecesJustificativesService.clone_attachments(original, kopy)
rescue ActiveStorage::FileNotFoundError, ActiveStorage::IntegrityError
end
PiecesJustificativesService.clone_attachments(original, kopy)
end
procedure.path = SecureRandom.uuid
procedure.aasm_state = :brouillon