From 9886ddd65e29f4f90069a32982bc797c62ccd925 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Wed, 15 Aug 2012 22:58:33 +0000 Subject: [PATCH] Don't show open price of 0% --- app/models/product.rb | 1 + 1 file changed, 1 insertion(+), 0 deletions(-) diff --git a/app/models/product.rb b/app/models/product.rb index 3f798f6..d8f854e 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -201,6 +201,7 @@ class Product < ActiveRecord::Base self.inputs(true).each{ |i| t_i += 1; se_i += 1 if i.is_from_solidarity_economy } t_i = 1 if t_i == 0 # avoid division by 0 p = case (se_i.to_f/t_i)*100 + when 0 then [0, ''] when 0..24.999 then [0, _("0%")]; when 25..49.999 then [25, _("25%")]; when 50..74.999 then [50, _("50%")]; -- libgit2 0.21.2