Followup fix for issue #1752 - tree got lost after update.

This commit is contained in:
Martin Edenhofer 2018-03-29 03:07:13 +02:00
parent 968074d8ef
commit a088321498
2 changed files with 3 additions and 3 deletions

View file

@ -127,7 +127,7 @@ class ObjectManagerAttributesController < ApplicationController
permitted[:data_option][:null] = true
end
if !permitted[:data_option][:options].is_a?(Hash)
if !permitted[:data_option][:options].is_a?(Hash) && !permitted[:data_option][:options].is_a?(Array)
permitted[:data_option][:options] = {}
end

View file

@ -21,12 +21,12 @@ class CheckForObjectAttributes < ActiveRecord::Migration[5.1]
end
def fix_nil_data_option(attribute)
return if attribute[:data_option].is_a?(Hash)
return if attribute[:data_option].is_a?(Hash) || attribute[:data_option][:options].is_a?(Array)
attribute[:data_option] = {}
end
def fix_options(attribute)
return if attribute[:data_option][:options].is_a?(Hash)
return if attribute[:data_option][:options].is_a?(Hash) || attribute[:data_option][:options].is_a?(Array)
attribute[:data_option][:options] = {}
end