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.

8 lines
244 B
Ruby
Raw Permalink Normal View History

# 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