mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 02:56:26 -05:00
8 lines
228 B
Ruby
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
|