2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-04-02 17:07:56 -04:00
|
|
|
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
|