Commit b11a1d85 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

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
parent c9ca635f
......@@ -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
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment