Sha256: 46bf362d9ea6c72c30ff349ee3f086f70ee3ee7ec097dbdee558113bc849aa14
Contents?: true
Size: 835 Bytes
Versions: 20
Compression:
Stored size: 835 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 if store_key Spree::Store.current(store_key) else Spree::Store.default end end private def store_key @request.headers['HTTP_SPREE_STORE'] || @request.env['SERVER_NAME'] end end end end
Version data entries
20 entries across 20 versions & 1 rubygems