Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-02-09 17:51:06 +0300
committerRémy Coutable <remy@rymai.me>2016-02-09 20:15:35 +0300
commitb34963bc125d11af7b9c993d1233258f084e580d (patch)
treea428e07d6da540a852a1f182073e16ee317546da /app/validators
parenta52c5778bb9d95097cc965539731a2ef846c3ff0 (diff)
Validate email addresses using Devise.email_regexp
Also: - Get rid of legacy :strict_mode - Get rid of custom :email validator - Add some shared examples to spec emails validation
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/email_validator.rb18
1 files changed, 0 insertions, 18 deletions
diff --git a/app/validators/email_validator.rb b/app/validators/email_validator.rb
deleted file mode 100644
index b35af100803..00000000000
--- a/app/validators/email_validator.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# EmailValidator
-#
-# Based on https://github.com/balexand/email_validator
-#
-# Extended to use only strict mode with following allowed characters:
-# ' - apostrophe
-#
-# See http://www.remote.org/jochen/mail/info/chars.html
-#
-class EmailValidator < ActiveModel::EachValidator
- PATTERN = /\A\s*([-a-z0-9+._']{1,64})@((?:[-a-z0-9]+\.)+[a-z]{2,})\s*\z/i.freeze
-
- def validate_each(record, attribute, value)
- unless value =~ PATTERN
- record.errors.add(attribute, options[:message] || :invalid)
- end
- end
-end