mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
14 lines
308 B
Ruby
14 lines
308 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "enum_site_setting"
|
|
|
|
class BaseFontSetting < EnumSiteSetting
|
|
def self.valid_value?(val)
|
|
values.any? { |v| v[:value].to_s == val.to_s }
|
|
end
|
|
|
|
def self.values
|
|
@values ||= DiscourseFonts.fonts.map { |font| { name: font[:name], value: font[:key] } }
|
|
end
|
|
end
|