don't overflow the progress bar

This commit is contained in:
Emi Matchu 2014-09-11 17:47:42 -05:00
parent 8e22c271a4
commit 2e08a1261b

View file

@ -4,7 +4,7 @@ class Campaign < ActiveRecord::Base
has_many :donations has_many :donations
def progress_percent def progress_percent
(progress.to_f / goal) * 100 [(progress.to_f / goal) * 100, 100].min
end end
def self.current def self.current