demarches-normaliennes/app/models/virus_scan.rb
2018-06-12 15:12:38 +02:00

17 lines
300 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