Fix lingering buglet (would not even run with Array)

This commit is contained in:
wvengen 2015-11-14 17:07:44 +01:00
parent c6b8b85f1f
commit 6bf693e0ee

View file

@ -246,7 +246,7 @@ class FoodsoftConfig
# Normalize value recursively (which can be entered as strings, but we want to store it properly) # Normalize value recursively (which can be entered as strings, but we want to store it properly)
def normalize_value(value) def normalize_value(value)
value = value.map(&:normalize_value) if value.is_a? Array value = value.map{|v| normalize_value(v)} if value.is_a? Array
if value.is_a? Hash if value.is_a? Hash
value = ActiveSupport::HashWithIndifferentAccess[ value.to_a.map{|a| [a[0], normalize_value(a[1])]} ] value = ActiveSupport::HashWithIndifferentAccess[ value.to_a.map{|a| [a[0], normalize_value(a[1])]} ]
end end