From 874f973f3af6b5dee65bfa3c55658430dadb5451 Mon Sep 17 00:00:00 2001 From: Radhika Chippada Date: Wed, 7 Jan 2015 14:27:00 -0500 Subject: [PATCH] 4523: exclude text type columns from searchable_columns for ilike operator --- .../workbench/test/integration/pipeline_instances_test.rb | 2 +- services/api/app/models/arvados_model.rb | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb index b4dc546d5e..6a5d097f14 100644 --- a/apps/workbench/test/integration/pipeline_instances_test.rb +++ b/apps/workbench/test/integration/pipeline_instances_test.rb @@ -443,7 +443,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest ['admin', nil, 40, 200], ['admin', 'FUSE project', 1, 1], ['admin', 'pipeline_10', 2, 2], - ['active', 'containing at least two', 2, 100], # component description + ['active', 'containing at least two', 0, 100], # components column (of type text) is currently not searchable ['active', nil, 10, 100], ['active', 'no such match', 0, 0], ].each do |user, search_filter, expected_min, expected_max| diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb index a170fb9b54..fc463378f6 100644 --- a/services/api/app/models/arvados_model.rb +++ b/services/api/app/models/arvados_model.rb @@ -60,8 +60,14 @@ class ArvadosModel < ActiveRecord::Base textonly_operator = !operator.match(/[<=>]/) self.columns.select do |col| case col.type - when :string, :text + when :string true + when :text + if operator == 'ilike' + false + else + true + end when :datetime, :integer, :boolean !textonly_operator else -- 2.39.5