Class: PackagingImportWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
app/workers/packaging_import_worker.rb

Overview

Re-seeds Packing records for a single Packaging row after it is saved.

Enqueued by Packaging#after_save so that dimension or box-assignment changes
propagate into the Packing MD5 lookup table without requiring a full
Shipping::PackagingImporter.process run.

Only processes records with number_items > 1. Single-item records are
handled by Shipping::ItemMd5Extractor on item save.

Instance Method Summary collapse

Instance Method Details

#perform(packaging_id) ⇒ Object



16
17
18
19
20
21
# File 'app/workers/packaging_import_worker.rb', line 16

def perform(packaging_id)
  packaging = Packaging.includes(:warehouse_package, store_item: :item).find_by(id: packaging_id)
  return unless packaging

  Shipping::PackagingImporter.process_one(packaging)
end