FIX: enum site settings UI was broken

This commit is contained in:
Neil Lalonde 2014-06-05 16:42:26 -04:00
parent 651def63e5
commit e114e47533

View file

@ -120,14 +120,15 @@ module SiteSettingExtension
.map do |s, v|
value = send(s)
type = types[get_data_type(s, value)]
opts = {setting: s,
opts = {
setting: s,
description: description(s),
default: v,
type: type.to_s,
value: value.to_s,
category: categories[s]
}
opts.merge({valid_values: enum_class(s).values, translate_names: enum_class(s).translate_names?}) if type == :enum
opts.merge!({valid_values: enum_class(s).values, translate_names: enum_class(s).translate_names?}) if type == :enum
opts[:choices] = choices[s] if choices.has_key? s
opts
end