blob: d0736ab0b09aa4555207c6ab377ee4444a381c31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  | 
class Import < ActiveRecord::Base
  mount_uploader :file, ImportUploader
  belongs_to :workbench
  belongs_to :referential
  extend Enumerize
  enumerize :status, in: %i(new pending successful failed running aborted canceled)
  validates :file, presence: true
  before_create do
    self.token_download = SecureRandom.urlsafe_base64
    self.status = Import.status.new
  end
end
  |