Commit c02c8061fa1ad30a25f6e3f470534435513b23eb

Authored by Braulio Bhavamitra
1 parent fed34abc

Return price if discount not available

This is necessary for products search view
Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/product.rb
@@ -104,7 +104,7 @@ class Product < ActiveRecord::Base @@ -104,7 +104,7 @@ class Product < ActiveRecord::Base
104 end 104 end
105 105
106 def price_with_discount 106 def price_with_discount
107 - price - discount if discount 107 + discount ? price - discount : price
108 end 108 end
109 109
110 def price=(value) 110 def price=(value)