about summary refs log tree commit diff
path: root/app/validators/unreserved_validator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/validators/unreserved_validator.rb')
-rw-r--r--app/validators/unreserved_validator.rb15
1 files changed, 0 insertions, 15 deletions
diff --git a/app/validators/unreserved_validator.rb b/app/validators/unreserved_validator.rb
deleted file mode 100644
index 4e5b9dafc..000000000
--- a/app/validators/unreserved_validator.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class UnreservedValidator < ActiveModel::EachValidator
-  def validate_each(record, attribute, value)
-    return if value.nil?
-    record.errors.add(attribute, I18n.t('accounts.reserved_username')) if reserved_username?(value)
-  end
-
-  private
-
-  def reserved_username?(value)
-    return false unless Setting.reserved_usernames
-    Setting.reserved_usernames.include?(value.downcase)
-  end
-end