summaryrefslogtreecommitdiff
path: root/app/models/email.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-02-09 17:59:47 +0100
committerRémy Coutable <remy@rymai.me>2016-02-09 18:15:35 +0100
commitb3635ee46a1e62d72ce84871e2a5984e6eabfbdf (patch)
treeda9f077646a7baa0b0aee9f7c2412fe271ac9814 /app/models/email.rb
parentb34963bc125d11af7b9c993d1233258f084e580d (diff)
downloadgitlab-ce-b3635ee46a1e62d72ce84871e2a5984e6eabfbdf.tar.gz
Re-add EmailValidator to avoid the repetition of format: { with: Devise.email_regexp }streamline-email-validation
Diffstat (limited to 'app/models/email.rb')
-rw-r--r--app/models/email.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/email.rb b/app/models/email.rb
index daa259ee2d2..b323d1edd10 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, uniqueness: true, format: { with: Devise.email_regexp }
+ validates :email, presence: true, uniqueness: true, email: true
validate :unique_email, if: ->(email) { email.email_changed? }
before_validation :cleanup_email