13561: Refactor version creation & sync logic.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 10 Oct 2018 01:16:30 +0000 (22:16 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 10 Oct 2018 01:16:30 +0000 (22:16 -0300)
commit1499536dae11776694d8cd99747a1d8625903b26
tree92e6a7a0b893bd660770b2a634d535d979f0f78b
parent0f11eb78e075445d1769b445ee12328bdb397781
13561: Refactor version creation & sync logic.

* Avoid overriding save! and move code to collection's callbacks.
* Use around_update to make the necessary actions and get a lock before saving.
* Arrange version creation and syncing actions so that they happen after the
  current version's update.
* Update test.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>
services/api/app/models/collection.rb
services/api/test/unit/collection_test.rb