Sha256: 4592cd39485699f2da9098b2e25de7fa70de8948096c88bfbc12b567b1e3c845

Contents?: true

Size: 500 Bytes

Versions: 131

Compression:

Stored size: 500 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

131 entries across 131 versions & 1 rubygems

Version Path
cm-admin-3.0.3 app/models/file_import.rb
cm-admin-3.0.2 app/models/file_import.rb
cm-admin-3.0.1 app/models/file_import.rb
cm-admin-3.0.0 app/models/file_import.rb
cm-admin-2.4.6 app/models/file_import.rb
cm-admin-2.4.5 app/models/file_import.rb
cm-admin-2.4.4 app/models/file_import.rb
cm-admin-2.4.3 app/models/file_import.rb
cm-admin-2.4.2 app/models/file_import.rb
cm-admin-2.4.1 app/models/file_import.rb
cm-admin-2.4.0 app/models/file_import.rb
cm-admin-2.3.4 app/models/file_import.rb
cm-admin-2.3.3 app/models/file_import.rb
cm-admin-2.3.2 app/models/file_import.rb
cm-admin-2.3.1 app/models/file_import.rb
cm-admin-2.3.0 app/models/file_import.rb
cm-admin-2.2.1 app/models/file_import.rb
cm-admin-2.2.0 app/models/file_import.rb
cm-admin-2.1.5 app/models/file_import.rb
cm-admin-2.1.4 app/models/file_import.rb