Changed wording if milestone already expired, using Date#past
This commit is contained in:
parent
6a932d0af5
commit
d62a8a4d50
1 changed files with 8 additions and 2 deletions
|
@ -29,7 +29,7 @@ class Milestone < ActiveRecord::Base
|
||||||
|
|
||||||
def expired?
|
def expired?
|
||||||
if due_date
|
if due_date
|
||||||
due_date < Date.today
|
due_date.past?
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
@ -58,7 +58,13 @@ class Milestone < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def expires_at
|
def expires_at
|
||||||
"expires at #{due_date.stamp("Aug 21, 2011")}" if due_date
|
if due_date
|
||||||
|
if due_date.past?
|
||||||
|
"expired at #{due_date.stamp("Aug 21, 2011")}"
|
||||||
|
else
|
||||||
|
"expires at #{due_date.stamp("Aug 21, 2011")}"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_be_closed?
|
def can_be_closed?
|
||||||
|
|
Loading…
Add table
Reference in a new issue