Sha256: 0ba88841dc27c55cc821238264fb80fd0c73938e468ec61f2f6d40575a51c48c
Contents?: true
Size: 516 Bytes
Versions: 25
Compression:
Stored size: 516 Bytes
Contents
# frozen_string_literal: true module Hyrax module VirusCheck extend ActiveSupport::Concern included do validate :must_not_detect_viruses def viruses? return false unless original_file&.new_record? # We have a new file to check VirusCheckerService.file_has_virus?(original_file) end def must_not_detect_viruses return true unless viruses? errors.add(:base, "Failed to verify uploaded file is not a virus") false end end end end
Version data entries
25 entries across 25 versions & 1 rubygems