Sha256: 2d831424a2bbc6990ed2c739d560ba1f78e7c7cd51ac5f4da4f5ddf136995573

Contents?: true

Size: 1.38 KB

Versions: 21

Compression:

Stored size: 1.38 KB

Contents

module Spree
  module Seeds
    class Stores
      prepend Spree::ServiceModule::Base

      def call
        default_store = Spree::Store.default

        if default_store.persisted?
          default_store.update!(default_country_id: Spree::Config[:default_country_id])
        else
          Spree::Store.new do |s|
            s.name                         = 'Spree Demo Site'
            s.code                         = 'spree'
            s.url                          = Rails.application.routes.default_url_options[:host] || 'demo.spreecommerce.org'
            s.mail_from_address            = 'no-reply@example.com'
            s.customer_support_email       = 'support@example.com'
            s.default_currency             = 'USD'
            s.default_country_id           = Spree::Config[:default_country_id]
            s.default_locale               = I18n.locale
            s.seo_title                    = 'Spree Commerce Demo Shop'
            s.meta_description             = 'This is the new Spree UX DEMO | OVERVIEW: http://bit.ly/new-spree-ux | DOCS: http://bit.ly/spree-ux-customization-docs | CONTACT: https://spreecommerce.org/contact/'
            s.facebook                     = 'spreecommerce'
            s.twitter                      = 'spreecommerce'
            s.instagram                    = 'spreecommerce'
          end.save!
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
spree_core-4.7.3 app/services/spree/seeds/stores.rb
spree_core-4.6.6 app/services/spree/seeds/stores.rb
spree_core-4.5.5 app/services/spree/seeds/stores.rb
spree_core-4.4.1 app/services/spree/seeds/stores.rb
spree_core-4.5.4 app/services/spree/seeds/stores.rb
spree_core-4.6.5 app/services/spree/seeds/stores.rb
spree_core-4.7.2 app/services/spree/seeds/stores.rb
spree_core-4.7.1 app/services/spree/seeds/stores.rb
spree_core-4.6.4 app/services/spree/seeds/stores.rb
spree_core-4.7.0 app/services/spree/seeds/stores.rb
spree_core-4.6.3 app/services/spree/seeds/stores.rb
spree_core-4.6.2 app/services/spree/seeds/stores.rb
spree_core-4.6.1 app/services/spree/seeds/stores.rb
spree_core-4.6.0 app/services/spree/seeds/stores.rb
spree_core-4.5.3 app/services/spree/seeds/stores.rb
spree_core-4.5.2 app/services/spree/seeds/stores.rb
spree_core-4.5.1 app/services/spree/seeds/stores.rb
spree_core-4.5.0 app/services/spree/seeds/stores.rb
spree_core-4.4.0 app/services/spree/seeds/stores.rb
spree_core-4.4.0.rc2 app/services/spree/seeds/stores.rb