discourse/lib/validators/selectable_avatars_enabled_validator.rb
Bianca Nenciu 25b8ed740b
DEV: Make site setting type uploaded_image_list use upload IDs (#10401)
It used to be a list of concatenated upload URLs which was prone to
break.
2020-10-13 16:17:06 +03:00

16 lines
306 B
Ruby

# frozen_string_literal: true
class SelectableAvatarsEnabledValidator
def initialize(opts = {})
@opts = opts
end
def valid_value?(value)
value == "f" || SiteSetting.selectable_avatars.size > 1
end
def error_message
I18n.t('site_settings.errors.empty_selectable_avatars')
end
end