[ARVADOS] created: 18267d52438fb1ece23135755da9f6881e32b99f

git at public.curoverse.com git at public.curoverse.com
Fri Feb 7 17:22:18 EST 2014


        at  18267d52438fb1ece23135755da9f6881e32b99f (commit)


commit 18267d52438fb1ece23135755da9f6881e32b99f
Author: Tim Pierce <twp at curoverse.com>
Date:   Fri Feb 7 17:22:43 2014 -0500

    Adding 'is_searchable' status for tables which should be full-text searchable.

diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 4f2aa72..5cbfd58 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -45,6 +45,13 @@ class ArvadosModel < ActiveRecord::Base
     end.compact
   end
 
+  # is_searchable returns 'true' if a model is subject to full-text
+  # search through the workbench.  Models which are searchable should
+  # return true.
+  def is_searchable
+    false
+  end
+
   def eager_load_associations
     self.class.columns.each do |col|
       re = col.name.match /^(.*)_kind$/
diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 03e5e4e..c6ecee3 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -8,6 +8,10 @@ class Collection < ArvadosModel
     t.add :files
   end
 
+  def is_searchable
+    true
+  end
+
   def redundancy_status
     if redundancy_confirmed_as.nil?
       'unconfirmed'
diff --git a/services/api/app/models/group.rb b/services/api/app/models/group.rb
index 9666257..7a1c9fb 100644
--- a/services/api/app/models/group.rb
+++ b/services/api/app/models/group.rb
@@ -7,4 +7,8 @@ class Group < ArvadosModel
     t.add :name
     t.add :description
   end
+
+  def is_searchable
+    true
+  end
 end
diff --git a/services/api/app/models/human.rb b/services/api/app/models/human.rb
index 3717f81..a87a041 100644
--- a/services/api/app/models/human.rb
+++ b/services/api/app/models/human.rb
@@ -7,4 +7,8 @@ class Human < ArvadosModel
   api_accessible :user, extend: :common do |t|
     t.add :properties
   end
+
+  def is_searchable
+    true
+  end
 end
diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb
index 17ca6cb..4a05f6b 100644
--- a/services/api/app/models/job.rb
+++ b/services/api/app/models/job.rb
@@ -37,6 +37,10 @@ class Job < ArvadosModel
     t.add :log_stream_href
   end
 
+  def is_searchable
+    true
+  end
+
   def assert_finished
     update_attributes(finished_at: finished_at || Time.now,
                       success: success.nil? ? false : success,
diff --git a/services/api/app/models/job_task.rb b/services/api/app/models/job_task.rb
index 7d568e9..03310cc 100644
--- a/services/api/app/models/job_task.rb
+++ b/services/api/app/models/job_task.rb
@@ -17,6 +17,10 @@ class JobTask < ArvadosModel
     t.add :success
   end
 
+  def is_searchable
+    true
+  end
+
   protected
 
   def delete_created_job_tasks_if_failed
diff --git a/services/api/app/models/link.rb b/services/api/app/models/link.rb
index 1d4e13d..3c701bf 100644
--- a/services/api/app/models/link.rb
+++ b/services/api/app/models/link.rb
@@ -29,6 +29,10 @@ class Link < ArvadosModel
     super
   end
 
+  def is_searchable
+    true
+  end
+
   protected
 
   def permission_to_attach_to_objects
diff --git a/services/api/app/models/log.rb b/services/api/app/models/log.rb
index 29efc9d..3e52395 100644
--- a/services/api/app/models/log.rb
+++ b/services/api/app/models/log.rb
@@ -16,6 +16,10 @@ class Log < ArvadosModel
     t.add :info
   end
 
+  def is_searchable
+    true
+  end
+
   protected
 
   def set_default_event_at
diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb
index 43497da..5df8756 100644
--- a/services/api/app/models/pipeline_instance.rb
+++ b/services/api/app/models/pipeline_instance.rb
@@ -21,6 +21,10 @@ class PipelineInstance < ArvadosModel
     t.add :properties
   end
 
+  def is_searchable
+    true
+  end
+
   def dependencies
     dependency_search(self.components).keys
   end
diff --git a/services/api/app/models/specimen.rb b/services/api/app/models/specimen.rb
index bcfcd7a..37de071 100644
--- a/services/api/app/models/specimen.rb
+++ b/services/api/app/models/specimen.rb
@@ -9,6 +9,10 @@ class Specimen < ArvadosModel
     t.add :properties
   end
 
+  def is_searchable
+    true
+  end
+
   def properties
     @properties ||= Hash.new
     super
diff --git a/services/api/app/models/trait.rb b/services/api/app/models/trait.rb
index 85ab236..ff3db80 100644
--- a/services/api/app/models/trait.rb
+++ b/services/api/app/models/trait.rb
@@ -8,4 +8,8 @@ class Trait < ArvadosModel
     t.add :name
     t.add :properties
   end
+
+  def is_searchable
+    true
+  end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list