From 54f8bdd13b43637d3a3e3742c3c3b6d3312dc518 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 29 Mar 2016 11:53:07 -0400 Subject: [PATCH] FIX: only validate username when changing it --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index e0663db08e1..9444fb8396f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -69,7 +69,7 @@ class User < ActiveRecord::Base before_validation :strip_downcase_email validates_presence_of :username - validate :username_validator + validate :username_validator, if: :username_changed? validates :email, presence: true, uniqueness: true validates :email, email: true, if: :email_changed? validate :password_validator