Commit c49a3106ff99250c2c678a2efec368021ea0e98e
Exists in
master
and in
4 other branches
Merge pull request #2350 from Razer6/milestone-expiration-date
Changed wording if milestone already expired
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,7 +29,7 @@ class Milestone < ActiveRecord::Base | ||
| 29 | 29 | ||
| 30 | def expired? | 30 | def expired? |
| 31 | if due_date | 31 | if due_date |
| 32 | - due_date < Date.today | 32 | + due_date.past? |
| 33 | else | 33 | else |
| 34 | false | 34 | false |
| 35 | end | 35 | end |
| @@ -58,7 +58,13 @@ class Milestone < ActiveRecord::Base | @@ -58,7 +58,13 @@ class Milestone < ActiveRecord::Base | ||
| 58 | end | 58 | end |
| 59 | 59 | ||
| 60 | def expires_at | 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 | end | 68 | end |
| 63 | 69 | ||
| 64 | def can_be_closed? | 70 | def can_be_closed? |