summaryrefslogtreecommitdiffstats
path: root/app/models/version.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/version.rb')
-rw-r--r--app/models/version.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/version.rb b/app/models/version.rb
index 0547dbabc..266346c7b 100644
--- a/app/models/version.rb
+++ b/app/models/version.rb
@@ -49,6 +49,14 @@ class Version < ActiveRecord::Base
end
end
+ def closed_pourcent
+ if fixed_issues.count == 0
+ 0
+ else
+ closed_issues_count * 100.0 / fixed_issues.count
+ end
+ end
+
# Returns true if the version is overdue: due date reached and some open issues
def overdue?
effective_date && (effective_date < Date.today) && (open_issues_count > 0)