Class: DataImportPrepWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job, Workers::StatusBroadcastable
Defined in:
app/workers/data_import_prep_worker.rb

Instance Attribute Summary

Attributes included from Workers::StatusBroadcastable

#broadcast_status_updates

Instance Method Summary collapse

Methods included from Workers::StatusBroadcastable::Overrides

#at, #store, #total

Instance Method Details

#perform(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'app/workers/data_import_prep_worker.rb', line 7

def perform(options={})
  options = options.with_indifferent_access
  
  data_import = DataImport.find(options['data_import_id'])
  data_import.populate_cells do |status|
    total status[:total]
    at(status[:position], status[:message])
  end
  
  store redirect_to: "/data_imports/#{data_import.id}"
end