Module: Spree::Core::ControllerHelpers::Store

Extended by:
ActiveSupport::Concern
Included in:
BaseController
Defined in:
lib/spree/core/controller_helpers/store.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.current_store_class#store

Extension point for overriding how the current store is chosen. Defaults to checking headers and server name

Returns:

  • (#store)

    class used to help find the current store



12
13
14
15
16
17
# File 'lib/spree/core/controller_helpers/store.rb', line 12

included do
  class_attribute :current_store_class
  self.current_store_class = Spree::Core::CurrentStore

  helper_method :current_store
end

Instance Method Details

#current_storeObject



19
20
21
# File 'lib/spree/core/controller_helpers/store.rb', line 19

def current_store
  @current_store ||= current_store_class.new(request).store
end