From 0a05151f05de44233d3c6ae0d53ecae2855f5a11 Mon Sep 17 00:00:00 2001 From: radhika Date: Wed, 2 Nov 2016 14:42:00 -0400 Subject: [PATCH 1/1] 10028: when an "is_a" filter is used while fetching contents, do not search in all "other" types. --- .../app/controllers/arvados/v1/groups_controller.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb index 7a5713a03c..d6adbf0851 100644 --- a/services/api/app/controllers/arvados/v1/groups_controller.rb +++ b/services/api/app/controllers/arvados/v1/groups_controller.rb @@ -75,7 +75,20 @@ class Arvados::V1::GroupsController < ApplicationController end end + wanted_klasses = [] + request_filters.each do |col,op,val| + if op == 'is_a' + (val.is_a?(Array) ? val : [val]).each do |type| + type = type.split('#')[-1] + type[0] = type[0].capitalize + wanted_klasses << type + end + end + end + klasses.each do |klass| + next if wanted_klasses.any? and !wanted_klasses.include?(klass.to_s) + # If the currently requested orders specifically match the # table_name for the current klass, apply that order. # Otherwise, order by recency. -- 2.30.2