summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2012-12-23 16:18:27 +0000
committerRobert Schilling <rschilling@student.tugraz.at>2012-12-23 21:16:51 +0000
commitd62a8a4d50c05748cb6760a503191531181dd8b0 (patch)
treeabe9df9a1353e4ea0d071e6b767bdd3b64946f3c /app/models/milestone.rb
parent6a932d0af511623ab2f9e9e00a28b0cbfd664372 (diff)
downloadgitlab-ce-d62a8a4d50c05748cb6760a503191531181dd8b0.tar.gz
Changed wording if milestone already expired, using Date#past
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 4fac9bec259..8b4c895dc17 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -29,7 +29,7 @@ class Milestone < ActiveRecord::Base
def expired?
if due_date
- due_date < Date.today
+ due_date.past?
else
false
end
@@ -58,7 +58,13 @@ class Milestone < ActiveRecord::Base
end
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
def can_be_closed?