17152: Moves conditional preserve_version disabling to collection's controller.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 11 Dec 2020 15:28:22 +0000 (12:28 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 11 Dec 2020 15:28:22 +0000 (12:28 -0300)
commitd5745d536d013a6731e0e6a872abe34d71f0995e
tree5d822133598f1531fd1e338e022c441606d8082b
parent653f8d8ba8d07a2d7081a924a67ee31b1a8ceebd
17152: Moves conditional preserve_version disabling to collection's controller.

There was a bug that flipped preserve_version to false after creating a new
version even though the update request included preserve_version=true.
This happened because the logic was at model level, and was incorrect because
at that level we cannot know if the client included the attribute on its
request.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>
services/api/app/controllers/arvados/v1/collections_controller.rb
services/api/app/models/collection.rb
services/api/test/functional/arvados/v1/collections_controller_test.rb
services/api/test/integration/collections_api_test.rb
services/api/test/unit/collection_test.rb