fix: Don't validate MX record in development (#7654)

lolsob-rspec
takayamaki 2018-05-29 02:14:24 +09:00 committed by Eugen Rochko
parent 49ee254971
commit 5a242be7ec
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ require 'resolv'
class EmailMxValidator < ActiveModel::Validator class EmailMxValidator < ActiveModel::Validator
def validate(user) def validate(user)
return if Rails.env.test? return if Rails.env.test? || Rails.env.development?
user.errors.add(:email, I18n.t('users.invalid_email')) if invalid_mx?(user.email) user.errors.add(:email, I18n.t('users.invalid_email')) if invalid_mx?(user.email)
end end