[ARVADOS] updated: adfc2c563d47c0eb70985245a1a7c4df004d7aa0

Git user git at public.curoverse.com
Thu Jun 16 10:33:42 EDT 2016


Summary of changes:
 apps/workbench/app/models/container_work_unit.rb | 30 ++++++------------------
 1 file changed, 7 insertions(+), 23 deletions(-)

       via  adfc2c563d47c0eb70985245a1a7c4df004d7aa0 (commit)
      from  bfdf3d5b0ab2b2747321f3d5e2fc3e18f165fefd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit adfc2c563d47c0eb70985245a1a7c4df004d7aa0
Author: radhika <radhika at curoverse.com>
Date:   Thu Jun 16 10:32:21 2016 -0400

    9372: The children of a Container will be ContainerRequests to which this is the requesting_container_uuid.

diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index ba2776b..036f8a4 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -14,30 +14,14 @@ class ContainerWorkUnit < ProxyWorkUnit
   def children
     return self.my_children if self.my_children
 
-    items = []
-
-    if @proxied.is_a?(Container)
-      # If @proxied is a container, get all containter_requests where this is
-      # requesting_container_uuid and containers for their container_uuids
-      crs = {}
-      reqs = ContainerRequest.where(requesting_container_uuid: uuid).results
-      reqs.each { |cr| crs[cr.container_uuid] = cr.name }
-
-      containers = Container.where(uuid: crs.keys).results
-      containers.each do |c|
-        items << c.work_unit(crs[c.uuid] || 'this container')
-      end
+    container_uuid = nil
+    container_uuid = if @proxied.is_a?(Container) then uuid else get(:container_uuid) end
 
-      self.my_children = items
-    else
-      # Else for a container_request, get all container_requests whose
-      # requesting_container_uuid is this container_request's container_uuid.
-      container_uuid = get(:container_uuid)
-      if container_uuid
-        reqs = ContainerRequest.where(requesting_container_uuid: container_uuid).results
-        reqs.each do |cr|
-          items << cr.work_unit(cr.name || 'this container')
-        end
+    items = []
+    if container_uuid
+      reqs = ContainerRequest.where(requesting_container_uuid: container_uuid).results
+      reqs.each do |cr|
+        items << cr.work_unit(cr.name || 'this container')
       end
     end
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list