X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3acff4c57e3459dae420903c02c717cd5c07319f..03395937ba05b9e3192e346a355c691f45cc7c85:/apps/workbench/app/models/collection.rb diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb index 94a2b95916..6022d82433 100644 --- a/apps/workbench/app/models/collection.rb +++ b/apps/workbench/app/models/collection.rb @@ -1,4 +1,17 @@ class Collection < ArvadosBase + include ApplicationHelper + + MD5_EMPTY = 'd41d8cd98f00b204e9800998ecf8427e' + + # 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 content_summary + human_readable_bytes_html(total_bytes) + " " + super + end + def total_bytes if files tot = 0 @@ -13,7 +26,16 @@ class Collection < ArvadosBase false end + def self.creatable? + false + end + def provenance - $arvados_api_client.api "collections/#{self.uuid}/", "provenance" + arvados_api_client.api "collections/#{self.uuid}/", "provenance" end + + def used_by + arvados_api_client.api "collections/#{self.uuid}/", "used_by" + end + end