From 917cdcde33c5a4ab7075a1d844d6dbe2540ab05a Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 17 Oct 2018 15:05:50 -0300 Subject: [PATCH] 13561: Fixes api to get a collection with its past versions. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- .../arvados/v1/collections_controller.rb | 13 ------------- .../arvados/v1/collections_controller_test.rb | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb index 18b88c4d47..5d7a7ae266 100644 --- a/services/api/app/controllers/arvados/v1/collections_controller.rb +++ b/services/api/app/controllers/arvados/v1/collections_controller.rb @@ -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 diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb index fdc54894fb..f5bed63849 100644 --- a/services/api/test/functional/arvados/v1/collections_controller_test.rb +++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb @@ -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 -- 2.39.5