limits username uniqueness when registering with oauth
This commit is contained in:
@@ -26,7 +26,7 @@ class User < ActiveRecord::Base
|
||||
belongs_to :geozone
|
||||
|
||||
validates :username, presence: true, if: :username_required?
|
||||
validates :username, uniqueness: true, if: :username_required?
|
||||
validates :username, uniqueness: { scope: :registering_with_oauth }, if: :username_required?
|
||||
validates :document_number, uniqueness: { scope: :document_type }, allow_nil: true
|
||||
|
||||
validate :validate_username_length
|
||||
|
||||
Reference in New Issue
Block a user