diff --git a/app/inputs/nested_select_input.rb b/app/inputs/nested_select_input.rb index c0027479..1d4a7523 100644 --- a/app/inputs/nested_select_input.rb +++ b/app/inputs/nested_select_input.rb @@ -68,7 +68,9 @@ def set_parent_value(level_data) parent_attribute = level_data[:parent_attribute] build_virtual_attr(parent_attribute) instance = instance_from_attribute_name(level_data[:attribute]) - if instance&.respond_to?(parent_attribute) + if @object&.respond_to?(parent_attribute) && @object.send(parent_attribute).present? + # do nothing + elsif instance&.respond_to?(parent_attribute) @object.send("#{parent_attribute}=", instance.send(parent_attribute)) end end