Class: Spree::SampleData::Loader

Inherits:
Object
  • Object
show all
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree/sample_data/loader.rb

Instance Method Summary collapse

Methods included from Spree::ServiceModule::Base

prepended

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/services/spree/sample_data/loader.rb', line 6

def call
  Spree::Events.disable do
    without_geocoding do
      ActiveRecord::Base.no_touching do
        ensure_seeds_loaded

        puts 'Loading sample configuration data...'
        load_configuration_data

        puts 'Loading sample markets...'
        load_ruby_file('markets')

        puts 'Loading sample metafield definitions...'
        load_ruby_file('metafield_definitions')

        puts 'Loading sample options...'
        load_ruby_file('options')

        puts 'Loading sample products...'
        load_products

        puts 'Loading sample product translations...'
        load_product_translations

        puts 'Loading sample customers...'
        load_customers

        puts 'Loading sample orders...'
        load_ruby_file('orders')

        puts 'Loading sample posts...'
        load_ruby_file('posts')

        puts 'Sample data loaded successfully!'
      end
    end
  end
end