Create virus scan model to store clamav result
This commit is contained in:
parent
645d112f5c
commit
927cd3c6f4
4 changed files with 40 additions and 0 deletions
17
app/models/virus_scan.rb
Normal file
17
app/models/virus_scan.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue