Sha256: 7126f074098ebad8d59e6d10cb0c8c2240b44bddb5effec2a7dbae8e917cf6c8

Contents?: true

Size: 501 Bytes

Versions: 24

Compression:

Stored size: 501 Bytes

Contents

class FileImport < ApplicationRecord
  include CmAdmin::FileImport

  belongs_to :added_by, polymorphic: true

  enum :status, { in_progress: 0, success: 1, failed: 2 }

  has_one_attached :import_file

  after_create_commit :process_uploaded_file

  store_accessor :error_report, :invalid_row_items


  def process_uploaded_file
    FileImportProcessorJob.perform_later(self)
  end

  def imported_file_name
    import_file.filename.to_s
  end

  def added_by_name
    added_by.first_name
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
cm-admin-4.4.8 app/models/file_import.rb
cm-admin-4.4.6 app/models/file_import.rb
cm-admin-4.4.1 app/models/file_import.rb
cm-admin-4.4.0 app/models/file_import.rb
cm-admin-4.3.0 app/models/file_import.rb
cm-admin-4.2.1 app/models/file_import.rb
cm-admin-4.2.0 app/models/file_import.rb
cm-admin-4.1.2 app/models/file_import.rb
cm-admin-4.1.1 app/models/file_import.rb
cm-admin-4.1.0 app/models/file_import.rb
cm-admin-4.0.0 app/models/file_import.rb
cm-admin-3.0.16 app/models/file_import.rb
cm-admin-3.0.15 app/models/file_import.rb
cm-admin-3.0.14 app/models/file_import.rb
cm-admin-3.0.13 app/models/file_import.rb
cm-admin-3.0.12 app/models/file_import.rb
cm-admin-3.0.11 app/models/file_import.rb
cm-admin-3.0.10 app/models/file_import.rb
cm-admin-3.0.9 app/models/file_import.rb
cm-admin-3.0.8 app/models/file_import.rb