X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e7c542383a6364d422a14704a8ab11c96a976a41..229952c156b8d031e4b5f8a9e58f2327c4884daa:/apps/workbench/app/models/container_work_unit.rb diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb index c564dc12e4..292bc3679b 100644 --- a/apps/workbench/app/models/container_work_unit.rb +++ b/apps/workbench/app/models/container_work_unit.rb @@ -25,11 +25,11 @@ class ContainerWorkUnit < ProxyWorkUnit container_uuid = if @proxied.is_a?(Container) then uuid else get(:container_uuid) end if container_uuid cols = ContainerRequest.columns.map(&:name) - %w(id updated_at mounts secret_mounts runtime_token) - my_children = @child_proxies || ContainerRequest.select(cols).where(requesting_container_uuid: container_uuid).results if !my_children + my_children = @child_proxies || ContainerRequest.select(cols).where(requesting_container_uuid: container_uuid).with_count("none").results if !my_children my_child_containers = my_children.map(&:container_uuid).compact.uniq grandchildren = {} my_child_containers.each { |c| grandchildren[c] = []} if my_child_containers.any? - reqs = ContainerRequest.select(cols).where(requesting_container_uuid: my_child_containers).results if my_child_containers.any? + reqs = ContainerRequest.select(cols).where(requesting_container_uuid: my_child_containers).order(["requesting_container_uuid", "uuid"]).with_count("none").results if my_child_containers.any? reqs.each {|cr| grandchildren[cr.requesting_container_uuid] << cr} if reqs my_children.each do |cr|