13561: Fixes api to get a collection with its past versions.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 17 Oct 2018 18:05:50 +0000 (15:05 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 17 Oct 2018 18:05:50 +0000 (15:05 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

services/api/app/controllers/arvados/v1/collections_controller.rb
services/api/test/functional/arvados/v1/collections_controller_test.rb

index 18b88c4d47c590dcbb6fa45892b1d6bfca06905d..5d7a7ae266b82fa918a47312c6584d0897a6231c 100644 (file)
@@ -235,17 +235,4 @@ class Arvados::V1::CollectionsController < ApplicationController
       @select ||= model_class.selectable_attributes - ["manifest_text", "unsigned_manifest_text"]
     end
   end
-
-  def load_filters_param
-    super
-    return if !params[:include_old_versions]
-    @filters = @filters.map do |col, operator, operand|
-      # Replace uuid filters when including past versions
-      if col == 'uuid'
-        ['current_version_uuid', operator, operand]
-      else
-        [col, operator, operand]
-      end
-    end
-  end
 end
index fdc54894fba5067e6180917d498b8e4e2306a77c..f5bed638497d0f9c62d6d130cf314576cb4c2685 100644 (file)
@@ -1197,7 +1197,7 @@ EOS
   test 'can get collection with past versions' do
     authorize_with :active
     get :index, {
-      filters: [['uuid','=',collections(:collection_owned_by_active).uuid]],
+      filters: [['current_version_uuid','=',collections(:collection_owned_by_active).uuid]],
       include_old_versions: true
     }
     assert_response :success