diff options
Diffstat (limited to 'app/models/version.rb')
-rw-r--r-- | app/models/version.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/models/version.rb b/app/models/version.rb index f96ccb012..50225f362 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -97,10 +97,10 @@ class Version < ActiveRecord::Base end def behind_schedule? - if completed_pourcent == 100 + if completed_percent == 100 return false elsif due_date && start_date - done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor + done_date = start_date + ((due_date - start_date+1)* completed_percent/100).floor return done_date <= Date.today else false # No issues so it's not late @@ -109,7 +109,7 @@ class Version < ActiveRecord::Base # Returns the completion percentage of this version based on the amount of open/closed issues # and the time spent on the open issues. - def completed_pourcent + def completed_percent if issues_count == 0 0 elsif open_issues_count == 0 @@ -119,8 +119,14 @@ class Version < ActiveRecord::Base end end + # TODO: remove in Redmine 3.0 + def completed_pourcent + ActiveSupport::Deprecation.warn "Version#completed_pourcent is deprecated and will be removed in Redmine 3.0. Please use #completed_percent instead." + completed_percent + end + # Returns the percentage of issues that have been marked as 'closed'. - def closed_pourcent + def closed_percent if issues_count == 0 0 else @@ -128,6 +134,12 @@ class Version < ActiveRecord::Base end end + # TODO: remove in Redmine 3.0 + def closed_pourcent + ActiveSupport::Deprecation.warn "Version#closed_pourcent is deprecated and will be removed in Redmine 3.0. Please use #closed_percent instead." + closed_percent + 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) |