Limit usernames to 30 chars, statuses to 500, open account after follow form success
This commit is contained in:
parent
62b384824d
commit
e9bc4a4a08
9 changed files with 25 additions and 13 deletions
|
@ -6,7 +6,7 @@ class Account < ApplicationRecord
|
|||
|
||||
# Local users
|
||||
has_one :user, inverse_of: :account
|
||||
validates :username, presence: true, format: { with: /\A[a-z0-9_]+\z/i, message: 'only letters, numbers and underscores' }, uniqueness: { scope: :domain, case_sensitive: false }, if: 'local?'
|
||||
validates :username, presence: true, format: { with: /\A[a-z0-9_]+\z/i, message: 'only letters, numbers and underscores' }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, if: 'local?'
|
||||
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
|
||||
|
||||
# Avatar upload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue