Class: Spree::Store

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/store.rb

Class Method Summary collapse

Methods inherited from Base

page

Methods included from Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Class Method Details

.current(domain = nil) ⇒ Object


13
14
15
16
# File 'app/models/spree/store.rb', line 13

def self.current(domain = nil)
  current_store = domain ? Store.by_url(domain).first : nil
  current_store || Store.default
end

.defaultObject


18
19
20
# File 'app/models/spree/store.rb', line 18

def self.default
  where(default: true).first || new
end