mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06: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
|