mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 03:23:45 +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
|