[inventory] don't double-link the children by appending it twice

master
Ryan 2020-01-21 17:13:40 -08:00
parent 88576efc04
commit c31256dde3
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ class InventoryObjectsController < ApplicationController
if params[:file_link_id]
# TODO: how to constrain this, it passed an untrusted boundary?
@file_datum = FileDatum.find(params[:file_link_id])
@object.links_to.append(@file_datum.attach_to(@object))
@file_datum.attach_to(@object)
end
@file_datum = FileDatum.new unless params[:file_link_id]