2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00
discourse/lib/validators/user_full_name_validator.rb

8 lines
228 B
Ruby

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