refacto suite à simplification virusscan

This commit is contained in:
clemkeirua 2019-05-03 17:28:23 +02:00
parent d0794f42d1
commit afa6711564
2 changed files with 1 additions and 9 deletions

View file

@ -1,6 +1,5 @@
class Dossier < ApplicationRecord
include DossierFilteringConcern
include VirusScanConcern
enum state: {
brouillon: 'brouillon',
@ -99,9 +98,6 @@ class Dossier < ApplicationRecord
after_save :send_web_hook
after_create :send_draft_notification_email
after_commit :create_dossier_virus_scan
after_initialize { add_virus_scan_on(self.justificatif_motivation) }
validates :user, presence: true
def update_search_terms
@ -417,8 +413,4 @@ class Dossier < ApplicationRecord
)
end
end
def create_dossier_virus_scan
create_virus_scan(self.justificatif_motivation)
end
end

View file

@ -1,6 +1,6 @@
- if dossier.present?
- justificatif = dossier.justificatif_motivation
- if dossier.justificatif_motivation.attached? and dossier.virus_scan.safe?
- if dossier.justificatif_motivation.attached? and dossier.justificatif_motivation.virus_scanner.safe?
.action
= link_to (justificatif), target: '_blank', class: 'button primary' do
%span.icon.download