From 66fee66db05d675fb796611da85e9036816fd191 Mon Sep 17 00:00:00 2001 From: Ilya Konanykhin Date: Thu, 26 Jan 2017 15:56:28 +0600 Subject: [PATCH] Fix: validate username presence & uniqueness --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/user.rb b/app/models/user.rb index b5fd9d0..5c62268 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,6 +26,7 @@ class User < ActiveRecord::Base default_scope order('username ASC') + validates :username, :presence => true, uniqueness: true validates :first_name, :presence => true validates :last_name, :presence => true