demarches-normaliennes/app/models/virus_scan.rb
2018-10-03 12:03:21 +02:00

17 lines
299 B
Ruby

class VirusScan < ApplicationRecord
belongs_to :champ
enum status: {
pending: 'pending',
safe: 'safe',
infected: 'infected'
}
validates :champ_id, uniqueness: { scope: :blob_key }
after_create :perform_scan
def perform_scan
AntiVirusJob.perform_later(self)
end
end