mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 16:28:21 +00:00
[Identity] only validate email if email changed
This commit is contained in:
parent
e6ed8a5687
commit
2f8454d0ca
1 changed files with 1 additions and 1 deletions
|
|
@ -85,7 +85,7 @@ class Identity < ApplicationRecord
|
|||
|
||||
validates :first_name, :last_name, :country, :primary_email, :birthday, presence: true
|
||||
validates :primary_email, uniqueness: { conditions: -> { where(deleted_at: nil) } }
|
||||
validate :validate_primary_email
|
||||
validate :validate_primary_email, if: -> { new_record? || primary_email_changed? }
|
||||
|
||||
validates :slack_id, uniqueness: { conditions: -> { where(deleted_at: nil) } }, allow_blank: true
|
||||
validates :aadhaar_number, uniqueness: true, allow_blank: true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue