simplify check for verified email in collection

This commit is contained in:
Alexis Reigel 2017-08-24 16:52:06 +02:00
parent d6c58a51e5
commit 3b090bb9a9

View file

@ -70,11 +70,11 @@ class GpgKey < ActiveRecord::Base
end
def verified?
emails_with_verified_status.any? { |_email, verified| verified }
emails_with_verified_status.values.any?
end
def verified_and_belongs_to_email?(email)
emails_with_verified_status.any? { |key_email, verified| key_email == email && verified }
emails_with_verified_status.fetch(email, false)
end
def update_invalid_gpg_signatures