diff options
author | Horatiu Eugen Vlad <horatiu@vlad.eu> | 2018-10-27 00:39:00 +0200 |
---|---|---|
committer | Horatiu Eugen Vlad <horatiu@vlad.eu> | 2019-03-05 19:56:01 +0000 |
commit | c8c0ea6c52d46ce63d838d1e739355d4deace434 (patch) | |
tree | a91cbe57b1cc4235f3be6b32f2829e200c73de09 /app/models/email.rb | |
parent | 60876192f89e41494cb56e2dc0a90f5f0dbfa716 (diff) | |
download | gitlab-ce-c8c0ea6c52d46ce63d838d1e739355d4deace434.tar.gz |
Align EmailValidator to validate_email gem implementation.
Renamed EmailValidator to DeviseEmailValidator to avoid 'email:' naming collision with ActiveModel::Validations::EmailValidator in 'validates' statement.
Make use of the options attribute of the parent class ActiveModel::EachValidator.
Add more options: regex.
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 3ce6e792fa8..7c33c5c7e64 100644 --- a/app/models/email.rb +++ b/app/models/email.rb @@ -7,7 +7,7 @@ class Email < ActiveRecord::Base belongs_to :user validates :user_id, presence: true - validates :email, presence: true, uniqueness: true, email: true + validates :email, presence: true, uniqueness: true, devise_email: true validate :unique_email, if: ->(email) { email.email_changed? } scope :confirmed, -> { where.not(confirmed_at: nil) } |