Skip to content

Commit

Permalink
save after setting parent
Browse files Browse the repository at this point in the history
it should be the responsibility of the caller to save this, not the mixin code
see the related ManageIQ/manageiq#20990
  • Loading branch information
d-m-u committed Jan 28, 2021
1 parent e174d80 commit 6d6c361
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/vms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def edit_resource(type, id, data)
attrs = validate_edit_data(data)
parent, children = build_parent_children(data)
resource_search(id, type, collection_class(type)).tap do |vm|
vm.update!(attrs)
vm.replace_children(children)
vm.set_parent(parent)
vm.update!(attrs)
end
rescue => err
raise BadRequestError, "Cannot edit VM - #{err}"
Expand Down

0 comments on commit 6d6c361

Please sign in to comment.