app/validators/email_validator.rb
def domain_typo?(value)
    domain = value.rpartition('@').last.downcase

    # Gmail domain typos
    if domain.start_with?('gmai', 'goog')
      return VALID_GMAIL_DOMAINS.exclude?(domain)
    end

    # Hotmail domain typos
    if domain.start_with?('hotm')
      return VALID_HOTMAIL_DOMAINS.exclude?(domain)
    end

    COMMON_DOMAIN_TYPOS.include?(domain)
  end
# Very simplistic but we see these typos quite frequently
Very simplistic but we see these typos quite frequently
Very simplistic but we see these typos quite frequently
def domain_typo?(value)
    domain = value.rpartition('@').last.downcase
    if domain.start_with?('gmai', 'goog')
      return VALID_GMAIL_DOMAINS.exclude?(domain)
    end
    if domain.start_with?('hotm')
      return VALID_HOTMAIL_DOMAINS.exclude?(domain)
    end
    COMMON_DOMAIN_TYPOS.include?(domain)
  end
def domain_typo? ( value ) domain = value . rpartition ( '@' ) . last . downcase if domain . start_with? ( 'gmai' , 'goog' ) return VALID_GMAIL_DOMAINS . exclude? ( domain ) end if domain . start_with? ( 'hotm' ) return VALID_HOTMAIL_DOMAINS . exclude? ( domain ) end COMMON_DOMAIN_TYPOS . include? ( domain ) end
Very simplistic but we see these typos quite frequently
Very simplistic but we see these typos quite frequently
# Gmail domain typos # Hotmail domain typos
value