Improve clone of procedure attachements

This commit is contained in:
Paul Chavard 2019-08-20 15:54:28 +02:00
parent cf6c33b9b5
commit b7b46e9a82

View file

@ -262,8 +262,10 @@ class Procedure < ApplicationRecord
if original_attachment.attached?
kopy.send(attribute).attach({
io: StringIO.new(original_attachment.download),
filename: original_attachment.blob.filename,
content_type: original_attachment.blob.content_type
filename: original_attachment.filename,
content_type: original_attachment.content_type,
# we don't want to run virus scanner on cloned file
metadata: { virus_scan_result: ActiveStorage::VirusScanner::SAFE }
})
end
end