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

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

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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