]>
cat aescling's git repositories - mastodon.git/blob - app/validators/unreserved_validator.rb
1 # frozen_string_literal: true
3 class UnreservedValidator
< ActiveModel
::EachValidator
4 def validate_each(record
, attribute
, value
)
6 record
.errors
.add(attribute
, I18n
.t('accounts.reserved_username')) if reserved_username
?(value
)
11 def reserved_username
?(value
)
12 return false unless Setting
.reserved_usernames
13 Setting
.reserved_usernames
.include?(value
.downcase
)
This page took 0.113319 seconds and 6 git commands to generate.