Class: Spree::Price
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spree::Price
- Defined in:
- app/models/spree/price.rb
Instance Method Summary collapse
- #display_amount ⇒ Object (also: #display_price)
- #money ⇒ Object
- #price ⇒ Object
- #price=(price) ⇒ Object
-
#variant ⇒ Object
Remove variant default_scope ‘deleted_at: nil`.
Instance Method Details
#display_amount ⇒ Object Also known as: display_price
9 10 11 |
# File 'app/models/spree/price.rb', line 9 def display_amount money end |
#money ⇒ Object
14 15 16 |
# File 'app/models/spree/price.rb', line 14 def money Spree::Money.new(amount || 0, { currency: currency }) end |
#price ⇒ Object
18 19 20 |
# File 'app/models/spree/price.rb', line 18 def price amount end |
#price=(price) ⇒ Object
22 23 24 |
# File 'app/models/spree/price.rb', line 22 def price=(price) self[:amount] = parse_price(price) end |