Fixed bug when selection list was cleared.
[arvados.git] / apps / workbench / app / helpers / provenance_helper.rb
index 6d6ae5516c838ebdfe0556948ee980e8f6782c2b..fced9da3aa98c6c728df6e950cb788a254e30ec0 100644 (file)
@@ -9,11 +9,13 @@ module ProvenanceHelper
     end
 
     def self.collection_uuid(uuid)
-      m = /^([a-f0-9]{32}(\+[0-9]+)?)(\+.*)?$/.match(uuid.to_s)
+      m = CollectionsHelper.match(uuid)
       if m
-        #if m[2]
-        return m[1]
-        #else
+        if m[2]
+          return m[1]+m[2]
+        else
+          return m[1]
+        end
         #  Collection.where(uuid: ['contains', m[1]]).each do |u|
         #    puts "fixup #{uuid} to #{u.uuid}"
         #    return u.uuid