mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 10:57:04 +08:00
14 lines
257 B
Ruby
14 lines
257 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ThemeSettingsManager::Enum < ThemeSettingsManager
|
||
|
def value
|
||
|
val = super
|
||
|
match = choices.find { |choice| choice == val || choice.to_s == val }
|
||
|
match || val
|
||
|
end
|
||
|
|
||
|
def choices
|
||
|
@opts[:choices]
|
||
|
end
|
||
|
end
|