Merge branch 'master' of git.clinicalfuture.com:arvados
[arvados.git] / services / api / app / models / arvados_model.rb
index 991755b48a67f9803bbcdf415c1552c09dec1ba2..2999b5271331ed9d11ef382fb826350d6646e417 100644 (file)
@@ -36,6 +36,14 @@ class ArvadosModel < ActiveRecord::Base
     "#{current_api_base}/#{self.class.to_s.pluralize.underscore}/#{self.uuid}"
   end
 
+  def self.searchable_columns
+    self.columns.collect do |col|
+      if [:string, :text].index(col.type) && col.name != 'owner_uuid'
+        col.name
+      end
+    end.compact
+  end
+
   def eager_load_associations
     self.class.columns.each do |col|
       re = col.name.match /^(.*)_kind$/