X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/64e387b2f4f0fe6c4c7bf16232706c7cf194caf0..01190b55cafa04ca0b73bf49fcb30f048fb934bf:/services/api/app/models/collection.rb diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb index caac5611e7..996981dba7 100644 --- a/services/api/app/models/collection.rb +++ b/services/api/app/models/collection.rb @@ -259,9 +259,10 @@ class Collection < ArvadosModel should_preserve_version = should_preserve_version? # Time sensitive, cache value return(yield) unless (should_preserve_version || syncable_updates.any?) - # Put aside the changes because with_lock forces a record reload + # Put aside the changes because with_lock requires an explicit record reload changes = self.changes snapshot = nil + reload with_lock do # Copy the original state to save it as old version if should_preserve_version