##// END OF EJS Templates
Closed issue are not overdue, fixes r2140 (#2337)....
Jean-Philippe Lang -
r2357:b11a1d852c37
parent child
Show More
@@ -215,7 +215,7 class Issue < ActiveRecord::Base
215 215
216 216 # Returns true if the issue is overdue
217 217 def overdue?
218 !due_date.nil? && (due_date < Date.today)
218 !due_date.nil? && (due_date < Date.today) && !status.is_closed?
219 219 end
220 220
221 221 # Users the issue can be assigned to
@@ -226,5 +226,6 class IssueTest < Test::Unit::TestCase
226 226 assert !Issue.new(:due_date => Date.today).overdue?
227 227 assert !Issue.new(:due_date => 1.day.from_now.to_date).overdue?
228 228 assert !Issue.new(:due_date => nil).overdue?
229 assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
229 230 end
230 231 end
General Comments 0
You need to be logged in to leave comments. Login now