Class: Spree::Seeds::Stores

Inherits:
Object
  • Object
show all
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree/seeds/stores.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
# File 'app/services/spree/seeds/stores.rb', line 6

def call
  return if Spree::Store.where(default: true).exists?

  Spree::Store.new do |s|
    s.name                         = 'Shop'
    s.code                         = 'shop'
    s.url                          = Rails.application.routes.default_url_options[:host] || 'localhost:3000'
    s.mail_from_address            = 'no-reply@example.com'
    s.customer_support_email       = 'support@example.com'
    s.default_currency             = 'USD'
    s.default_country_iso          = 'US'
    s.default_locale               = I18n.locale
  end.save!
end