X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2ce797b91ad36d8b682f19b99732d2465b938019..fefce5e8e133a8fa064bbcdf31d85d41dc4a6729:/services/api/app/models/collection.rb diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb index 457fb5f778..334f3c699b 100644 --- a/services/api/app/models/collection.rb +++ b/services/api/app/models/collection.rb @@ -21,14 +21,22 @@ class Collection < ArvadosModel t.add :properties t.add :portable_data_hash t.add :signed_manifest_text, as: :manifest_text + t.add :replication_desired end def self.attributes_required_columns - # If we don't list this explicitly, the params[:select] code gets - # confused by the way we expose signed_manifest_text as - # manifest_text in the API response, and never let clients select - # the manifest_text column. - super.merge('manifest_text' => ['manifest_text']) + super.merge( + # If we don't list manifest_text explicitly, the + # params[:select] code gets confused by the way we + # expose signed_manifest_text as manifest_text in the + # API response, and never let clients select the + # manifest_text column. + 'manifest_text' => ['manifest_text'], + + # This is a shim until the database column gets + # renamed to replication_desired in #3410. + 'replication_desired' => ['redundancy'], + ) end def check_signatures @@ -175,6 +183,11 @@ class Collection < ArvadosModel end end + def replication_desired + # Shim until database columns get fixed up in #3410. + redundancy or 2 + end + def redundancy_status if redundancy_confirmed_as.nil? 'unconfirmed' @@ -300,6 +313,10 @@ class Collection < ArvadosModel super - ["manifest_text"] end + def self.full_text_searchable_columns + super - ["manifest_text"] + end + protected def portable_manifest_text portable_manifest = self[:manifest_text].dup