discourse/lib/theme_settings_manager/enum.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
257 B
Ruby
Raw Permalink Normal View History

# 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