Class: Spree::SampleData::LoadJob
- Defined in:
- app/jobs/spree/sample_data/load_job.rb
Overview
Loads the demo catalog, customers and orders in the background. Enqueued by first-run setup when the merchant ticks "load sample data": the loader needs an admin to own its imports and downloads product images, so it can neither run before setup nor inside the setup request.
Constant Summary
Constants inherited from BaseJob
Instance Method Summary collapse
Instance Method Details
#perform(store_id = nil) ⇒ Object
10 11 12 13 14 15 |
# File 'app/jobs/spree/sample_data/load_job.rb', line 10 def perform(store_id = nil) return Spree::SampleData::Loader.call if store_id.nil? store = Spree::Store.find_by(id: store_id) Spree::SampleData::Loader.call(store: store) if store end |