X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1b79dc4a25091e035a1c02693ecfcb8453649c27..7d598997ce1851f37ac0ec21c47abc76d5e84277:/apps/workbench/app/models/collection.rb diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb index ae86108bd9..764817509a 100644 --- a/apps/workbench/app/models/collection.rb +++ b/apps/workbench/app/models/collection.rb @@ -1,12 +1,20 @@ class Collection < ArvadosBase MD5_EMPTY = 'd41d8cd98f00b204e9800998ecf8427e' + def default_name + if Collection.is_empty_blob_locator? self.uuid + "Empty Collection" + else + super + end + end + # Return true if the given string is the locator of a zero-length blob def self.is_empty_blob_locator? locator !!locator.to_s.match("^#{MD5_EMPTY}(\\+.*)?\$") end - def self.goes_in_folders? + def self.goes_in_projects? true end @@ -21,6 +29,8 @@ class Collection < ArvadosBase tot += file[2] end tot + else + 0 end end @@ -46,7 +56,7 @@ class Collection < ArvadosBase dir_to_tree.call('.') end - def attribute_editable?(attr) + def attribute_editable? attr, *args false end