diff --git a/app/controllers/object_manager_attributes_controller.rb b/app/controllers/object_manager_attributes_controller.rb index a61e8516b..ab55ba001 100644 --- a/app/controllers/object_manager_attributes_controller.rb +++ b/app/controllers/object_manager_attributes_controller.rb @@ -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 diff --git a/db/migrate/20180220171219_check_for_object_attributes.rb b/db/migrate/20180220171219_check_for_object_attributes.rb index ec2ebe05a..6b76a6a3d 100644 --- a/db/migrate/20180220171219_check_for_object_attributes.rb +++ b/db/migrate/20180220171219_check_for_object_attributes.rb @@ -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