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

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
18
19
20
# File 'lib/spree/core/controller_helpers/store.rb', line 12

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

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