diff options
author | swellard <swellard@perforce.com> | 2015-06-15 18:35:41 +0300 |
---|---|---|
committer | swellard <swellard@perforce.com> | 2015-06-16 16:24:05 +0300 |
commit | 98615ef536186d2aff95c02246ef30254ab9b1f2 (patch) | |
tree | 9d988123e9c5a032b5a938b1823cb351834daaa9 /app | |
parent | bd6239f8cf75d110b3e53eabb9395f29cdff6a21 (diff) |
Fix duplicate 'Email has already been taken' message when creating a user
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 6ac287203b1..25b46da2aaf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -137,7 +137,9 @@ class User < ActiveRecord::Base # Validations # validates :name, presence: true - validates :email, presence: true, email: { strict_mode: true }, uniqueness: true + # Note that a 'uniqueness' and presence check is provided by devise :validatable for email. We do not need to + # duplicate that here as the validation framework will have duplicate errors in the event of a failure + validates :email, presence: true, email: { strict_mode: true } validates :notification_email, presence: true, email: { strict_mode: true } validates :public_email, presence: true, email: { strict_mode: true }, allow_blank: true, uniqueness: true validates :bio, length: { maximum: 255 }, allow_blank: true |