Class: Spree::Store
- Defined in:
- app/models/spree/store.rb
Overview
Records store specific configuration such as store name and URL.
Spree::Store provides the foundational ActiveRecord model for recording information
specific to your store such as its name, URL, and tax location. This model will
provide the foundation upon which support for multiple stores
hosted by a single Solidus implementation can be built.
Class Method Summary collapse
Instance Method Summary collapse
- #available_locales ⇒ Object
- #available_locales=(locales) ⇒ Object
- #default_cart_tax_location ⇒ Object
Methods inherited from Base
Methods included from Core::Permalinks
#generate_permalink, #save_permalink
Class Method Details
.default ⇒ Object
46 47 48 |
# File 'app/models/spree/store.rb', line 46 def self.default where(default: true).first || new end |
Instance Method Details
#available_locales ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/models/spree/store.rb', line 28 def available_locales locales = super() if locales super().split(",").map(&:to_sym) else Spree.i18n_available_locales end end |
#available_locales=(locales) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/models/spree/store.rb', line 37 def available_locales=(locales) locales = locales.reject(&:blank?) if locales.empty? super(nil) else super(locales.map(&:to_s).join(",")) end end |