7453: Add "Add new group" button to user admin page.
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index 4f89f262b7d0fb6e933716c8b534dd058a5c021d..db3d43040c416bef846a19d8ee0b4009a9e8f622 100644 (file)
@@ -707,6 +707,7 @@ class ApplicationController < ActionController::Base
   @@notification_tests = []
 
   @@notification_tests.push lambda { |controller, current_user|
+    return nil if Rails.configuration.shell_in_a_box_url
     AuthorizedKey.limit(1).where(authorized_user_uuid: current_user.uuid).each do
       return nil
     end
@@ -1094,7 +1095,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 +1121,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