FEATURE: make full names a required field of user profiles with the full_name_required setting

This commit is contained in:
Neil Lalonde
2015-04-02 17:07:56 -04:00
parent b63e9450a6
commit 30b063c08b
10 changed files with 74 additions and 3 deletions

View File

@ -0,0 +1,8 @@
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