FIX: only validate username when changing it
This commit is contained in:
parent
b3354bdc7b
commit
54f8bdd13b
|
@ -69,7 +69,7 @@ class User < ActiveRecord::Base
|
||||||
before_validation :strip_downcase_email
|
before_validation :strip_downcase_email
|
||||||
|
|
||||||
validates_presence_of :username
|
validates_presence_of :username
|
||||||
validate :username_validator
|
validate :username_validator, if: :username_changed?
|
||||||
validates :email, presence: true, uniqueness: true
|
validates :email, presence: true, uniqueness: true
|
||||||
validates :email, email: true, if: :email_changed?
|
validates :email, email: true, if: :email_changed?
|
||||||
validate :password_validator
|
validate :password_validator
|
||||||
|
|
Loading…
Reference in New Issue