address issue #2059

This commit is contained in:
Brandon Murphy 2017-08-04 07:02:22 -07:00
parent af5da3a165
commit 94605f5772

View file

@ -14,7 +14,7 @@ class User < ActiveRecord::Base
validates_presence_of :username
validates :username, uniqueness: { case_sensitive: false }
validates_format_of :username, :with => /\A[a-zA-Z0-9_-]{3,15}\Z/, :message => "can only contain letters, numbers, underscores, and dashes, and must be between 3 and 15 characters in length."
validates_format_of :username, :with => /\A[a-zA-Z0-9_-]{3,190}\Z/, :message => "can only contain letters, numbers, underscores, and dashes, and must be between 3 and 190 characters in length."
validates_inclusion_of :invitation_code, :on => :create, :in => INVITATION_CODES, :message => "is not valid", if: -> { !requires_no_invitation_code? && User.using_invitation_code? }
has_many :user_credentials, :dependent => :destroy, :inverse_of => :user