diff options
author | Rémy Coutable <remy@rymai.me> | 2016-02-09 15:51:06 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-02-09 18:15:35 +0100 |
commit | b34963bc125d11af7b9c993d1233258f084e580d (patch) | |
tree | a428e07d6da540a852a1f182073e16ee317546da /app/models/email.rb | |
parent | a52c5778bb9d95097cc965539731a2ef846c3ff0 (diff) | |
download | gitlab-ce-b34963bc125d11af7b9c993d1233258f084e580d.tar.gz |
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/models/email.rb')
-rw-r--r-- | app/models/email.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/email.rb b/app/models/email.rb index 935705e2ed4..daa259ee2d2 100644 --- a/app/models/email.rb +++ b/app/models/email.rb @@ -15,7 +15,7 @@ class Email < ActiveRecord::Base belongs_to :user validates :user_id, presence: true - validates :email, presence: true, email: { strict_mode: true }, uniqueness: true + validates :email, presence: true, uniqueness: true, format: { with: Devise.email_regexp } validate :unique_email, if: ->(email) { email.email_changed? } before_validation :cleanup_email |