From d62a8a4d50c05748cb6760a503191531181dd8b0 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sun, 23 Dec 2012 16:18:27 +0000 Subject: [PATCH] Changed wording if milestone already expired, using Date#past --- app/models/milestone.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 4fac9bec..8b4c895d 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?