summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-01-28 13:13:11 -0500
committerRubén Dávila <rdavila84@gmail.com>2016-02-02 17:47:18 -0500
commitd618e9c8f819053c9c3122cfa1baa4f61d0aebce (patch)
tree81705040f36fd80f859d7aabba716a47613ff8fb /app/models/milestone.rb
parent0a08b105801dd9eb0c32e2619a905650e7fe46e5 (diff)
downloadgitlab-ce-d618e9c8f819053c9c3122cfa1baa4f61d0aebce.tar.gz
Add specs.
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 21a3ab5227f..e75a2f89d90 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -111,6 +111,7 @@ class Milestone < ActiveRecord::Base
end
def percent_time_used
+ return 0 unless due_date
return 100 if expired?
duration = ((created_at - due_date.to_datetime) / 1.day)