Add email verification rake task for one domain only

This commit is contained in:
Alex Sherman 2020-06-16 13:41:35 +05:00
parent b4369bdcd0
commit 57cd588eee
3 changed files with 29 additions and 1 deletions

View file

@ -13,6 +13,8 @@ class EmailAddressVerification < ApplicationRecord
where.not(verified_at: nil).where(success: false)
}
scope :by_domain, ->(domain_name) { where(domain: domain_name) }
def recently_verified?
verified_at.present? &&
verified_at > verification_period