mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
require usernames to be alphanumeric
This commit is contained in:
parent
97a4926c24
commit
d75cc4b07f
@ -13,6 +13,7 @@ class User < ApplicationRecord
|
||||
|
||||
validates_uniqueness_of :username, allow_nil: true, allow_blank: true
|
||||
validates :username, length: { in: 1..20 }
|
||||
validates :username, with: /^[A-Za-z0-9]+$/
|
||||
|
||||
has_many :subscriptions, dependent: :destroy
|
||||
has_many :billing_plans, through: :subscriptions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user