[ARVADOS] updated: 1.1.3-87-g05ececf
Git user
git at public.curoverse.com
Mon Feb 26 12:27:21 EST 2018
Summary of changes:
services/api/app/models/collection.rb | 11 +++++++++++
1 file changed, 11 insertions(+)
via 05ececf6335372a971bc26ae3566b374131ce66e (commit)
from 281fe0c40c16aacd82cd1ca122e38aa3a3854f2e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 05ececf6335372a971bc26ae3566b374131ce66e
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Mon Feb 26 14:26:41 2018 -0300
12707: Adds default value setting on collection creation.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 221176e..a088d48 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -19,6 +19,7 @@ class Collection < ArvadosModel
serialize :storage_classes_confirmed, Array
before_validation :default_empty_manifest
+ before_validation :default_storage_classes, on: :create
before_validation :check_encoding
before_validation :check_manifest_validity
before_validation :check_signatures
@@ -453,6 +454,16 @@ class Collection < ArvadosModel
protected
+ # Although the defaults for these columns is already set up on the schema,
+ # collection creation from an API client seems to ignore them, making the
+ # validation on empty desired storage classes return an error.
+ def default_storage_classes
+ if self.storage_classes_desired.nil? || self.storage_classes_desired.empty?
+ self.storage_classes_desired = ["default"]
+ end
+ self.storage_classes_confirmed ||= []
+ end
+
def portable_manifest_text
self.class.munge_manifest_locators(manifest_text) do |match|
if match[2] # size
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list