Merge branch 'master' into 4523-search-index
[arvados.git] / services / api / app / models / arvados_model.rb
index 13ccd7033560318c2db2687928a08a4e5de0d44e..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
@@ -445,6 +451,10 @@ class ArvadosModel < ActiveRecord::Base
     "_____-#{uuid_prefix}-_______________"
   end
 
+  def self.uuid_regex
+    %r/[a-z0-9]{5}-#{uuid_prefix}-[a-z0-9]{15}/
+  end
+
   def ensure_valid_uuids
     specials = [system_user_uuid]