X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eae1286badb67ee63888633ff59bda9cb736131e..28b6afc1e8ccf652c7a8fd43e22a8ac788febd85:/apps/workbench/app/controllers/trash_items_controller.rb diff --git a/apps/workbench/app/controllers/trash_items_controller.rb b/apps/workbench/app/controllers/trash_items_controller.rb index 7d6e1431ce..d8f7ae62c8 100644 --- a/apps/workbench/app/controllers/trash_items_controller.rb +++ b/apps/workbench/app/controllers/trash_items_controller.rb @@ -78,10 +78,10 @@ class TrashItemsController < ApplicationController base_search = base_search.filter([["modified_at", "<=", last_mod_at], ["uuid", "not in", last_uuids]]) end - base_search = base_search.include_trash(true).limit(limit).offset(offset) + base_search = base_search.include_trash(true).limit(limit).with_count("none").offset(offset) if params[:filters].andand.length.andand > 0 - tags = Link.filter(params[:filters]) + tags = Link.filter(params[:filters]).with_count("none") tagged = [] if tags.results.length > 0 tagged = query_on.include_trash(true).where(uuid: tags.collect(&:head_uuid)) @@ -95,14 +95,14 @@ class TrashItemsController < ApplicationController owner_uuids = @objects.collect(&:owner_uuid).uniq @owners = {} @not_trashed = {} - Group.filter([["uuid", "in", owner_uuids]]).include_trash(true).each do |grp| - @owners[grp.uuid] = grp + [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 - User.filter([["uuid", "in", owner_uuids]]).include_trash(true).each do |grp| - @owners[grp.uuid] = grp - @not_trashed[grp.uuid] = true - end - Group.filter([["uuid", "in", owner_uuids]]).select([:uuid]).each do |grp| + Group.filter([["uuid", "in", owner_uuids]]).with_count("none").select([:uuid]).each do |grp| @not_trashed[grp.uuid] = true end else