Closed issue are not overdue, fixes r2140 (#2337).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2361 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-02-03 17:32:07 +00:00
parent c9ca635fa7
commit b11a1d852c
2 changed files with 2 additions and 1 deletions

View File

@ -215,7 +215,7 @@ class Issue < ActiveRecord::Base
# Returns true if the issue is overdue
def overdue?
!due_date.nil? && (due_date < Date.today)
!due_date.nil? && (due_date < Date.today) && !status.is_closed?
end
# Users the issue can be assigned to

View File

@ -226,5 +226,6 @@ class IssueTest < Test::Unit::TestCase
assert !Issue.new(:due_date => Date.today).overdue?
assert !Issue.new(:due_date => 1.day.from_now.to_date).overdue?
assert !Issue.new(:due_date => nil).overdue?
assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
end
end