Commit d62a8a4d50c05748cb6760a503191531181dd8b0
1 parent
6a932d0a
Exists in
master
and in
4 other branches
Changed wording if milestone already expired, using Date#past
Showing
1 changed file
with
8 additions
and
2 deletions
Show diff stats
app/models/milestone.rb
... | ... | @@ -29,7 +29,7 @@ class Milestone < ActiveRecord::Base |
29 | 29 | |
30 | 30 | def expired? |
31 | 31 | if due_date |
32 | - due_date < Date.today | |
32 | + due_date.past? | |
33 | 33 | else |
34 | 34 | false |
35 | 35 | end |
... | ... | @@ -58,7 +58,13 @@ class Milestone < ActiveRecord::Base |
58 | 58 | end |
59 | 59 | |
60 | 60 | def expires_at |
61 | - "expires at #{due_date.stamp("Aug 21, 2011")}" if due_date | |
61 | + if due_date | |
62 | + if due_date.past? | |
63 | + "expired at #{due_date.stamp("Aug 21, 2011")}" | |
64 | + else | |
65 | + "expires at #{due_date.stamp("Aug 21, 2011")}" | |
66 | + end | |
67 | + end | |
62 | 68 | end |
63 | 69 | |
64 | 70 | def can_be_closed? | ... | ... |