Correct :username validate format
This commit is contained in:
parent
0fccf79089
commit
7f5114d0f1
|
@ -57,7 +57,7 @@ class User < ActiveRecord::Base
|
|||
|
||||
VALID_USERNAME = /[A-Za-z0-9][A-Za-z0-9_-]{0,24}/
|
||||
validates :username,
|
||||
:format => { :with => /\A#{VALID_USERNAME}\Z/ },
|
||||
:format => { :with => /\A#{VALID_USERNAME}\z/ },
|
||||
:uniqueness => { :case_sensitive => false }
|
||||
|
||||
validates_each :username do |record,attr,value|
|
||||
|
|
Loading…
Reference in a new issue