X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7c3e13d4876a8e37feffee3cdaebc44b20b7b61b..2508b089d2369bf57811f9f96c14c2ee22dd664f:/apps/workbench/app/controllers/trash_items_controller.rb?ds=sidebyside diff --git a/apps/workbench/app/controllers/trash_items_controller.rb b/apps/workbench/app/controllers/trash_items_controller.rb index 12ef20aa66..d8f7ae62c8 100644 --- a/apps/workbench/app/controllers/trash_items_controller.rb +++ b/apps/workbench/app/controllers/trash_items_controller.rb @@ -95,12 +95,12 @@ class TrashItemsController < ApplicationController owner_uuids = @objects.collect(&:owner_uuid).uniq @owners = {} @not_trashed = {} - Group.filter([["uuid", "in", owner_uuids]]).with_count("none").include_trash(true).each do |grp| - @owners[grp.uuid] = grp - end - User.filter([["uuid", "in", owner_uuids]]).with_count("none").include_trash(true).each do |grp| - @owners[grp.uuid] = grp - @not_trashed[grp.uuid] = true + [Group, User].each do |owner_class| + owner_class.filter([["uuid", "in", owner_uuids]]).with_count("none") + .include_trash(true).fetch_multiple_pages(false) + .each do |owner| + @owners[owner.uuid] = owner + end end Group.filter([["uuid", "in", owner_uuids]]).with_count("none").select([:uuid]).each do |grp| @not_trashed[grp.uuid] = true