Build response objects based on item type rather than list type.
authorTom Clegg <tom@curoverse.com>
Tue, 22 Apr 2014 04:52:42 +0000 (00:52 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 22 Apr 2014 04:52:42 +0000 (00:52 -0400)
apps/workbench/app/models/arvados_api_client.rb

index 39036bc8bf1ef8b90f3131bf4c00eb8d0aa9ebbc..cf141063eadc58b9f96c715a961f78371187588b 100644 (file)
@@ -108,7 +108,7 @@ class ArvadosApiClient
 
   def unpack_api_response(j, kind=nil)
     if j.is_a? Hash and j[:items].is_a? Array and j[:kind].match(/(_list|List)$/)
-      ary = j[:items].collect { |x| unpack_api_response x, j[:kind] }
+      ary = j[:items].collect { |x| unpack_api_response x, x[:kind] }
       self.class.patch_paging_vars(ary, j[:items_available], j[:offset], j[:limit])
     elsif j.is_a? Hash and (kind || j[:kind])
       oclass = self.kind_class(kind || j[:kind])