0
0
Fork 0

Periodically remove expired PuSH subscribers (#4654)

This commit is contained in:
Eugen Rochko 2017-08-21 22:56:33 +02:00 committed by GitHub
parent 143b77e10d
commit f391a4673a
6 changed files with 15 additions and 4 deletions

View file

@ -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)