mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 18:23:42 +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
|