Class: Spree::Store
- Defined in:
- app/models/spree/store.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
display_includes, #initialize_preference_defaults, page, preference
Methods included from Preferences::Preferable
#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Class Method Details
.current(store_key = nil) ⇒ Object
17 18 19 20 21 |
# File 'app/models/spree/store.rb', line 17 def self.current(store_key = nil) Spree::Deprecation.warn "Spree::Store.current needs a code or URL as an argument. If you want the default store use Spree::Store.default", caller if !store_key current_store = Store.find_by(code: store_key) || Store.by_url(store_key).first if store_key current_store || Store.default end |
.default ⇒ Object
23 24 25 |
# File 'app/models/spree/store.rb', line 23 def self.default where(default: true).first || new end |