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
10 11 12 |
# File 'app/models/spree/price.rb', line 10 def display_amount money end |
#money ⇒ Object
15 16 17 |
# File 'app/models/spree/price.rb', line 15 def money Spree::Money.new(amount || 0, { currency: currency }) end |
#price ⇒ Object
19 20 21 |
# File 'app/models/spree/price.rb', line 19 def price amount end |
#price=(price) ⇒ Object
23 24 25 |
# File 'app/models/spree/price.rb', line 23 def price=(price) self[:amount] = parse_price(price) end |