summaryrefslogtreecommitdiff
path: root/lib/email_validator.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-08 12:47:09 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-08 12:47:09 +0100
commit048605bd33935cd2b37c72bf2b725e9c37e1f6e8 (patch)
treecaf35eb873412ae71721e9244c1f899e351cff3e /lib/email_validator.rb
parenta426fb1596978221510c8c78a17703658ad7d161 (diff)
parentf5430e48b42227f1c1874ca27c6907f0f704be28 (diff)
downloadgitlab-ce-issue-closing-docs.tar.gz
Merge branch 'master' into issue-closing-docsissue-closing-docs
Diffstat (limited to 'lib/email_validator.rb')
-rw-r--r--lib/email_validator.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/email_validator.rb b/lib/email_validator.rb
deleted file mode 100644
index f509f0a5843..00000000000
--- a/lib/email_validator.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
- @@default_options = {}
-
- def self.default_options
- @@default_options
- end
-
- def validate_each(record, attribute, value)
- options = @@default_options.merge(self.options)
- unless value =~ /\A\s*([-a-z0-9+._']{1,64})@((?:[-a-z0-9]+\.)+[a-z]{2,})\s*\z/i
- record.errors.add(attribute, options[:message] || :invalid)
- end
- end
-end