demarches-normaliennes/app/models/virus_scan.rb

18 lines
300 B
Ruby
Raw Normal View History

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