Sha256: 1c08988c0e89117d623522ec6d9f74d26c36e1e81998f553c8235c5301c0a696
Contents?: true
Size: 756 Bytes
Versions: 6
Compression:
Stored size: 756 Bytes
Contents
# Default class for deciding what the current store is, given an HTTP request # This is an extension point used in Spree::Core::ControllerHelpers::Store # Custom versions of this class must respond to a store instance method module Spree module Core class CurrentStore def initialize(request) @request = request end # Chooses the current store based on a request. # Checks request headers for HTTP_SPREE_STORE and falls back to # looking up by the requesting server's name. # @return [Spree::Store] def store Spree::Store.current(store_key) end private def store_key @request.headers['HTTP_SPREE_STORE'] || @request.env['SERVER_NAME'] end end end end
Version data entries
6 entries across 6 versions & 1 rubygems