4523: exclude text type columns from searchable_columns for ilike operator
authorRadhika Chippada <radhika@curoverse.com>
Wed, 7 Jan 2015 19:27:00 +0000 (14:27 -0500)
committerRadhika Chippada <radhika@curoverse.com>
Wed, 7 Jan 2015 19:27:00 +0000 (14:27 -0500)
apps/workbench/test/integration/pipeline_instances_test.rb
services/api/app/models/arvados_model.rb

index b4dc546d5e718f305d8b397c0e5f507538e76e38..6a5d097f146d2cadce40ae902c0509c90beea504 100644 (file)
@@ -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|
index a170fb9b54368e3d8f77689604e2d1d5dd7ff301..fc463378f6833550467f2bb754d072b309b71845 100644 (file)
@@ -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