mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-03 05:29:42 +08:00
7 lines
244 B
Ruby
7 lines
244 B
Ruby
# 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
|