[ARVADOS] updated: 529dbc0b24f9dc06c3af1abaadd97374419d9507
Git user
git at public.curoverse.com
Fri Jun 17 11:12:54 EDT 2016
Summary of changes:
apps/workbench/app/models/container_work_unit.rb | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
via 529dbc0b24f9dc06c3af1abaadd97374419d9507 (commit)
from adfc2c563d47c0eb70985245a1a7c4df004d7aa0 (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 529dbc0b24f9dc06c3af1abaadd97374419d9507
Author: radhika <radhika at curoverse.com>
Date: Fri Jun 17 11:11:48 2016 -0400
9372: improve container_work_unit -> uri method to check if @proxied will respond_to table_name instead of using a rescue.
diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index 036f8a4..037a6e5 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -34,9 +34,16 @@ class ContainerWorkUnit < ProxyWorkUnit
def uri
uuid = get(:uuid)
- "/#{@proxied.class.table_name}/#{uuid}" rescue nil
- end
+ return nil unless uuid
+
+ if @proxied.class.respond_to? :table_name
+ "/#{@proxied.class.table_name}/#{uuid}"
+ else
+ resource_class = ArvadosBase.resource_class_for_uuid(uuid)
+ "#{resource_class.table_name}/#{uuid}" if resource_class
+ end
+ end
def can_cancel?
@proxied.is_a?(ContainerRequest) && state_label.in?(["Queued", "Locked", "Running"]) && priority > 0
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list