discourse/lib/validators/user_full_name_validator.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
259 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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