Class: Spree::Current
- Inherits:
-
ActiveSupport::CurrentAttributes
- Object
- ActiveSupport::CurrentAttributes
- Spree::Current
- Defined in:
- app/models/spree/current.rb
Instance Method Summary collapse
- #currency ⇒ Object
- #global_pricing_context ⇒ Object
- #price_lists ⇒ Object
- #store ⇒ Object
- #zone ⇒ Object
Instance Method Details
#currency ⇒ Object
9 10 11 |
# File 'app/models/spree/current.rb', line 9 def currency super || store&.default_currency end |
#global_pricing_context ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'app/models/spree/current.rb', line 24 def global_pricing_context super || begin self.global_pricing_context = Spree::Pricing::Context.new( currency: currency, store: store, zone: zone ) end end |
#price_lists ⇒ Object
17 18 19 20 21 22 |
# File 'app/models/spree/current.rb', line 17 def price_lists super || begin context = global_pricing_context self.price_lists = Spree::PriceList.for_context(context) end end |
#store ⇒ Object
5 6 7 |
# File 'app/models/spree/current.rb', line 5 def store super || Spree::Store.default end |
#zone ⇒ Object
13 14 15 |
# File 'app/models/spree/current.rb', line 13 def zone super || Spree::Zone.default_tax || store&.checkout_zone end |