Rails app:update

This commit is contained in:
Paul Chavard 2020-01-28 12:02:06 +01:00 committed by Pierre de La Morinerie
parent fc3aece318
commit 6a24c3f812
15 changed files with 79 additions and 27 deletions

View file

@ -1,6 +1,4 @@
class ActiveStorage::VirusScanner
include ActiveStorage::Downloading
def initialize(blob)
@blob = blob
end
@ -32,7 +30,7 @@ class ActiveStorage::VirusScanner
end
def metadata
download_blob_to_tempfile do |file|
blob.open do |file|
if ClamavService.safe_file?(file.path)
{ virus_scan_result: SAFE, scanned_at: Time.zone.now }
else