mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: allow multiple secondary emails
This commit is contained in:

committed by
Guo Xiang Tan

parent
98478d78d7
commit
c3129444ea
@ -11,7 +11,7 @@ class UserEmail < ActiveRecord::Base
|
||||
validates :email, email: true, format: { with: EmailValidator.email_regex },
|
||||
if: :validate_email?
|
||||
|
||||
validates :primary, uniqueness: { scope: [:user_id] }, if: :user_id
|
||||
validates :primary, uniqueness: { scope: [:user_id] }, if: [:user_id, :primary]
|
||||
validate :user_id_not_changed, if: :primary
|
||||
validate :unique_email
|
||||
|
||||
|
Reference in New Issue
Block a user