Merge pull request #1914 from internetee/1837-invalidate-emails-with-bounces

Add check for bounce presence in #failed? method of verification
This commit is contained in:
Timo Võhmar 2021-04-13 17:53:25 +03:00 committed by GitHub
commit fb1045a97e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -34,13 +34,17 @@ class EmailAddressVerification < ApplicationRecord
end
def failed?
verified_at.present? && !success
bounce_present? || (verified_at.present? && !success)
end
def verified?
success
end
def bounce_present?
BouncedMailAddress.find_by(email: email).present?
end
def check_force_delete
return unless failed?