Don't validate if email blank

parent cf7733ea
......@@ -2,6 +2,8 @@
class EmailPermutationValidator < ActiveModel::Validator
def validate(user)
return if user.email.blank?
@email = user.email
@blocked_emails = ENV['BLOCKED_EMAILS'].split(',')
user.errors.add(:email, I18n.t('users.invalid_email')) if blocked_email?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment