[ARVADOS] updated: 66da5859254325690a78512d03b6b02e3f69a237

git at public.curoverse.com git at public.curoverse.com
Wed Jun 4 13:38:05 EDT 2014


Summary of changes:
 .../app/controllers/application_controller.rb        | 20 +++++++++-----------
 apps/workbench/app/views/users/_tables.html.erb      |  8 ++++++--
 2 files changed, 15 insertions(+), 13 deletions(-)

       via  66da5859254325690a78512d03b6b02e3f69a237 (commit)
      from  349ab8f9e11d462c878cd6be6d24bf5790af3d50 (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 66da5859254325690a78512d03b6b02e3f69a237
Author: radhika <radhika at curoverse.com>
Date:   Wed Jun 4 13:37:00 2014 -0400

    2871: get collections methods return all collections for the given uuid.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index df41884..e39d776 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -494,12 +494,11 @@ class ApplicationController < ActionController::Base
     return @objects_map_for[dataclass]
   end
 
-  # helper method to get collection for the given uuid
-  helper_method :get_collection
-  def get_collection uuid
+  # helper method to get collections for the given uuid
+  helper_method :get_collections
+  def get_collections uuid
     preload_collections([uuid])
-    (@all_collections_for[uuid] && @all_collections_for[uuid].first) ?
-          [@all_collections_for[uuid].first] : []
+    @all_collections_for[uuid]
   end
 
   # helper method to preload collections for the given uuids
@@ -521,14 +520,13 @@ class ApplicationController < ActionController::Base
     end
   end
 
-  # helper method to get log collection for the given log
-  helper_method :get_log_collection
-  def get_log_collection log
+  # helper method to get log collections for the given log
+  helper_method :get_log_collections
+  def get_log_collections log
     fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(log)
     uuid = fixup[1]
     preload_log_collections([uuid])
-    (@all_log_collections_for[uuid] && @all_log_collections_for[uuid].first) ?
-          [@all_log_collections_for[uuid].first] : []
+    @all_log_collections_for[uuid]
   end
 
   # helper method to preload collections for the given uuids
@@ -551,7 +549,7 @@ class ApplicationController < ActionController::Base
     end
 
     # TODO: make sure we get every page of results from API server
-    Collection.limit(100).where(uuid: uuids).each do |collection|
+    Collection.where(uuid: uuids).each do |collection|
       @all_log_collections_for[collection.uuid] << collection
     end
   end
diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index c271f2b..bfce00f 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -48,7 +48,9 @@
               <small>
                 <% if j.success and j.output %>
                   <a href="<%= collection_path(j.output) %>">
-                    <% get_collection(j.output).each do |c| %>
+                    <% collections = get_collections(j.output) %>
+                      <% if collections && !collections.empty? %>
+                      <% c = collections.first %>
                       <% c.files.each do |file| %>
                         <%= file[0] == '.' ? file[1] : "#{file[0]}/#{file[1]}" %>
                       <% end %>
@@ -61,7 +63,9 @@
 <td>
   <small>
     <% if j.log %>
-      <% get_log_collection(j.log).each do |c| %>
+      <% log_collections = get_log_collections(j.log) %>
+      <% if log_collections && !log_collections.empty? %>
+        <% c = log_collections.first %>
         <% c.files.each do |file| %>
           <a href="<%= collection_path(j.log) %>/<%= file[1] %>?disposition=inline&size=<%= file[2] %>">Log</a>
         <% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list