diff --git a/app/models/product.rb b/app/models/product.rb index 4e2cdf0..2f393ef 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -104,7 +104,7 @@ class Product < ActiveRecord::Base end def price_with_discount - price - discount if discount + discount ? price - discount : price end def price=(value) -- libgit2 0.21.2