Module: Spree::CustomDomains::StoreDecorator::ClassMethods

Defined in:
app/models/spree/custom_domains/store_decorator.rb

Instance Method Summary collapse

Instance Method Details

#current(url = nil) ⇒ Object

Resolve a store from a request host. Core's Store.current ignores the URL and returns Spree::Current.store; with custom domains a host can map to a specific store.



21
22
23
24
25
# File 'app/models/spree/custom_domains/store_decorator.rb', line 21

def current(url = nil)
  return Spree::Current.store if url.blank?

  Spree.current_store_finder.new(url: url).execute
end