diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-08-21 22:56:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-21 22:56:33 +0200 |
commit | f391a4673adc6d79bb3a46b493d599a4bf6d558f (patch) | |
tree | 2476bd3bf983ff3dfb1d90da4e8fceeeab9667cb /app/models | |
parent | 143b77e10d984d3790382758c0b797215850b024 (diff) |
Periodically remove expired PuSH subscribers (#4654)
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/subscription.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/subscription.rb b/app/models/subscription.rb index bf643c1f9..14f1a140c 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -26,6 +26,7 @@ class Subscription < ApplicationRecord scope :confirmed, -> { where(confirmed: true) } scope :future_expiration, -> { where(arel_table[:expires_at].gt(Time.now.utc)) } + scope :expired, -> { where(arel_table[:expires_at].lt(Time.now.utc)) } scope :active, -> { confirmed.future_expiration } def lease_seconds=(value) |