mirror of
https://github.com/discourse/discourse.git
synced 2024-12-19 17:14:06 +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
|