5417: add "unreadable inputs provided" visual cue for an editable pipeline instance.
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index 4f89f262b7d0fb6e933716c8b534dd058a5c021d..db00be390a7e6846c2c8983efb90c2f213fd4336 100644 (file)
@@ -1094,7 +1094,7 @@ class ApplicationController < ActionController::Base
     pdhs.each do |x|
       @all_pdhs_for[x] = []
     end
-    # TODO: make sure we get every page of results from API server
+
     Collection.select(%w(portable_data_hash)).where(portable_data_hash: pdhs).distinct().each do |collection|
       @all_pdhs_for[collection.portable_data_hash] << collection
     end
@@ -1120,10 +1120,14 @@ class ApplicationController < ActionController::Base
     return @objects_for if uuids.empty?
 
     # if already preloaded for all of these uuids, return
-    if not uuids.select { |x| @objects_for[x].nil? }.any?
+    if not uuids.select { |x| !@objects_for.include?(x) }.any?
       return @objects_for
     end
 
+    # preset all uuids to nil
+    uuids.each do |x|
+      @objects_for[x] = nil
+    end
     dataclass.where(uuid: uuids).each do |obj|
       @objects_for[obj.uuid] = obj
     end