Sha256: ae2c647a7313ea903eaf5f7c767e168f87dac681226d878457aa7b72b2fbccf0
Contents?: true
Size: 449 Bytes
Versions: 16
Compression:
Stored size: 449 Bytes
Contents
class FileUpload < ApplicationRecord belongs_to :record, polymorphic: true has_one_attached :file delegate :open, :content_type, to: :file validates_presence_of :file validates_inclusion_of :scan_status, in: %w[uploaded scan_failed scanned quarantined] after_commit :scan def clean? scan_status == "scanned" end def filename file.filename.to_s end private def scan FileScanJob.perform_later self end end
Version data entries
16 entries across 16 versions & 1 rubygems