0
0
Fork 0

Specs for cleanup workers (#3235)

* Add spec files for feed and media cleanup workers

* Add coverage for feed and media cleanup schedulers

* Clean up feed and media cleanup workers
This commit is contained in:
Matt Jankowski 2017-05-22 13:36:21 -04:00 committed by Eugen Rochko
parent 4a4733b397
commit ec34ec63b1
6 changed files with 39 additions and 2 deletions

View file

@ -35,6 +35,7 @@
class User < ApplicationRecord
include Settings::Extend
ACTIVE_DURATION = 14.days
devise :registerable, :recoverable,
:rememberable, :trackable, :validatable, :confirmable,
@ -51,6 +52,7 @@ class User < ApplicationRecord
scope :recent, -> { order(id: :desc) }
scope :admins, -> { where(admin: true) }
scope :confirmed, -> { where.not(confirmed_at: nil) }
scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) }
before_validation :sanitize_languages