summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/license_status/active.rb8
-rw-r--r--app/models/license_status/expired.rb5
2 files changed, 6 insertions, 7 deletions
diff --git a/app/models/license_status/active.rb b/app/models/license_status/active.rb
index f959efb..512fff9 100644
--- a/app/models/license_status/active.rb
+++ b/app/models/license_status/active.rb
@@ -1,7 +1,7 @@
class LicenseStatus::Active
def filter(licenses)
- today = Date.today
- licenses.where('issued_at < ? AND expired_at > ?', today, today)
+ now = DateTime.now
+ licenses.where('issued_at < ? AND expired_at > ?', now, now)
end
def matches?(name)
@@ -9,8 +9,8 @@ class LicenseStatus::Active
end
def best_represents?(license)
- today = Date.today
- license.issued_at < today && license.expired_at > today
+ now = DateTime.now
+ license.issued_at < now && license.expired_at > now
end
def to_s
diff --git a/app/models/license_status/expired.rb b/app/models/license_status/expired.rb
index 8e24af9..9bbdf4b 100644
--- a/app/models/license_status/expired.rb
+++ b/app/models/license_status/expired.rb
@@ -1,7 +1,6 @@
class LicenseStatus::Expired
def filter(licenses)
- today = DateTime.now
- licenses.where('expired_at < ?', today)
+ licenses.where('expired_at < ?', DateTime.now)
end
def matches?(name)
@@ -9,7 +8,7 @@ class LicenseStatus::Expired
end
def best_represents?(license)
- license.expired_at < Date.today
+ license.expired_at < DateTime.now
end
def to_s