Fix validation. Refs #2136
This commit is contained in:
parent
e7071b501b
commit
f7045179c5
|
@ -23,7 +23,7 @@ class User < ActiveRecord::Base
|
|||
include PersonalRepository
|
||||
|
||||
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /^[a-zA-Z0-9_]+$/ }, :allow_nil => false, :allow_blank => false
|
||||
validates :ssh_key, :uniqueness => true
|
||||
validates :ssh_key, :uniqueness => true, :allow_blank => true
|
||||
validate { errors.add(:uname, :taken) if Group.where('uname LIKE ?', uname).present? }
|
||||
#TODO: Replace this simple cross-table uniq validation by more progressive analog
|
||||
validate lambda {
|
||||
|
|
Loading…
Reference in New Issue