Class: Spree::Price
- Inherits:
-
Base
- Object
- ActiveRecord::Base
- Base
- Spree::Price
show all
- Defined in:
- app/models/spree/price.rb
Instance Method Summary
collapse
Methods inherited from Base
page
#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
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] = Spree::LocalizedNumber.parse(price)
end
|
#variant ⇒ Object
Remove variant default_scope ‘deleted_at: nil`
28
29
30
|
# File 'app/models/spree/price.rb', line 28
def variant
Spree::Variant.unscoped { super }
end
|