diff options
Diffstat (limited to 'app/models/account.rb')
-rw-r--r-- | app/models/account.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index f418a0f8b..726e6c127 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -52,10 +52,10 @@ class Account < ApplicationRecord has_one :user, inverse_of: :account validates :username, presence: true - validates :username, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?' + validates :username, uniqueness: { scope: :domain, case_sensitive: true }, unless: :local? # Local user validations - with_options if: 'local?' do + with_options if: :local? do validates :username, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 } validates :display_name, length: { maximum: 30 } validates :note, length: { maximum: 160 } |