[ARVADOS] updated: 1be91cdf5926f71acba0f7360ab7efbe879f375b

git at public.curoverse.com git at public.curoverse.com
Mon Jul 21 14:57:57 EDT 2014


Summary of changes:
 apps/workbench/app/helpers/application_helper.rb | 4 ----
 apps/workbench/app/models/collection.rb          | 8 ++++++++
 2 files changed, 8 insertions(+), 4 deletions(-)

       via  1be91cdf5926f71acba0f7360ab7efbe879f375b (commit)
      from  2e66bcd03991218292328f09c5520876862eb5e1 (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 1be91cdf5926f71acba0f7360ab7efbe879f375b
Author: Tim Pierce <twp at curoverse.com>
Date:   Mon Jul 21 14:56:17 2014 -0400

    3072: rendering "Empty Collection" in default_name
    
    Collection.default_name now renders "Empty Collection" for collection
    d41d8cd98f00b204e9800998ecf8427e.
    
    Refs #3072.

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 5b5034f..d1bac0c 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -90,10 +90,6 @@ module ApplicationHelper
       if !link_name
         link_name = object.andand.default_name || resource_class.default_name
 
-        if resource_class == Collection && Collection.is_empty_blob_locator?(link_uuid)
-          link_name = "Empty Collection"
-        end
-
         if opts[:friendly_name]
           if attrvalue.respond_to? :friendly_link_name
             link_name = attrvalue.friendly_link_name
diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb
index 008d108..7648175 100644
--- a/apps/workbench/app/models/collection.rb
+++ b/apps/workbench/app/models/collection.rb
@@ -1,6 +1,14 @@
 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}(\\+.*)?\$")

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list