Merge branch 'master' into 4523-full-text-search
[arvados.git] / services / api / app / models / arvados_model.rb
index e5665e867079a825b28bf7d4db4754d033679383..5fc2d7873bec18ab3a55d18e29ca14dbaa185bef 100644 (file)
@@ -56,6 +56,12 @@ class ArvadosModel < ActiveRecord::Base
     "#{current_api_base}/#{self.class.to_s.pluralize.underscore}/#{self.uuid}"
   end
 
+  def self.selectable_attributes(template=:user)
+    # Return an array of attribute name strings that can be selected
+    # in the given template.
+    api_accessible_attributes(template).map { |attr_spec| attr_spec.first.to_s }
+  end
+
   def self.searchable_columns operator
     textonly_operator = !operator.match(/[<=>]/)
     self.columns.select do |col|