From: Peter Amstutz Date: Thu, 25 Aug 2016 16:58:32 +0000 (-0400) Subject: 9043: Use match_uuid_with_optional_filepath instead of hardcoded uuid regex. X-Git-Tag: 1.1.0~773^2~5 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/b7e7c0861ed70524e8aff0aa82a35a887619dff8 9043: Use match_uuid_with_optional_filepath instead of hardcoded uuid regex. --- diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index ec2e93fc16..e5bc0bfe92 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -466,9 +466,10 @@ module ApplicationHelper selection_param = object.class.to_s.underscore + dn if attrvalue.is_a? Hash display_value = attrvalue[:"arv:collection"] || attrvalue[:location] - display_value.match /^([0-9a-z]{5}-([0-9a-z]{5})-[0-9a-z]{15})(\/.*)?$/ do |re| - if re[3] - display_value = "#{Collection.find(re[1]).name} / #{re[3][1..-1]}" + re = CollectionsHelper.match_uuid_with_optional_filepath(display_value) + if re + if re[4] + display_value = "#{Collection.find(re[1]).name} / #{re[4][1..-1]}" else display_value = Collection.find(re[1]).name end