0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/lib/validators/user_full_name_validator.rb
2023-01-09 12:10:19 +00:00

7 lines
244 B
Ruby
Vendored

# frozen_string_literal: true
class UserFullNameValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
record.errors.add(attribute, :blank) if SiteSetting.full_name_required && !record.name.present?
end
end