Class: Spree::Price

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/spree/price.rb

Instance Method Summary collapse

Instance Method Details

#display_amountObject Also known as: display_price



9
10
11
# File 'app/models/spree/price.rb', line 9

def display_amount
  money
end

#moneyObject



14
15
16
# File 'app/models/spree/price.rb', line 14

def money
  Spree::Money.new(amount || 0, { currency: currency })
end

#priceObject



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

#variantObject

Remove variant default_scope ‘deleted_at: nil`



27
28
29
# File 'app/models/spree/price.rb', line 27

def variant
  Spree::Variant.unscoped { super }
end