Merge pull request #4222 from tchak/improve-procedure-clone-attachements

Improve clone of procedure attachements
This commit is contained in:
Paul Chavard 2019-08-21 08:19:30 +02:00 committed by GitHub
commit 10a859cedf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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