X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/764da69855e222afd3ba888c34e6fe10f3578aca..32ad82494652c10e4dfdf7c61782ab6a7684aba0:/services/api/app/controllers/arvados/v1/collections_controller.rb diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb index b174879d09..440ac64016 100644 --- a/services/api/app/controllers/arvados/v1/collections_controller.rb +++ b/services/api/app/controllers/arvados/v1/collections_controller.rb @@ -13,10 +13,10 @@ class Arvados::V1::CollectionsController < ApplicationController (super rescue {}). merge({ include_trash: { - type: 'boolean', required: false, description: "Include collections whose is_trashed attribute is true." + type: 'boolean', required: false, default: false, description: "Include collections whose is_trashed attribute is true.", }, include_old_versions: { - type: 'boolean', required: false, description: "Include past collection versions." + type: 'boolean', required: false, default: false, description: "Include past collection versions.", }, }) end @@ -25,7 +25,7 @@ class Arvados::V1::CollectionsController < ApplicationController (super rescue {}). merge({ include_trash: { - type: 'boolean', required: false, description: "Show collection even if its is_trashed attribute is true." + type: 'boolean', required: false, default: false, description: "Show collection even if its is_trashed attribute is true.", }, include_old_versions: { type: 'boolean', required: false, default: true, description: "Include past collection versions.", @@ -43,6 +43,14 @@ class Arvados::V1::CollectionsController < ApplicationController super end + def update + # preserve_version should be disabled unless explicitly asked otherwise. + if !resource_attrs[:preserve_version] + resource_attrs[:preserve_version] = false + end + super + end + def find_objects_for_index opts = { include_trash: params[:include_trash] || ['destroy', 'trash', 'untrash'].include?(action_name),