Skip to content

Commit

Permalink
MONGOID-5026 - Remove code comments and close ticket (#5605)
Browse files Browse the repository at this point in the history
* Close MONGOID-5026

* Update updatable.rb
  • Loading branch information
johnnyshields authored Nov 13, 2023
1 parent ca3c6a5 commit 0c85796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 3 additions & 4 deletions lib/mongoid/persistable/updatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,15 @@ def update_document(options = {})
unless updates.empty?
coll = collection(_root)
selector = atomic_selector

# TODO: DRIVERS-716: If a new "Bulk Write" API is introduced, it may
# become possible to handle the writes for conflicts in the following call.
coll.find(selector).update_one(positionally(selector, updates), session: _session)

# The following code applies updates which would cause
# path conflicts in MongoDB, for example when changing attributes
# of foo.0.bars while adding another foo. Each conflicting update
# is applied using its own write.
#
# TODO: MONGOID-5026: reduce the number of writes performed by
# more intelligently combining the writes such that there are
# fewer conflicts.
conflicts.each_pair do |modifier, changes|

# Group the changes according to their root key which is
Expand Down
5 changes: 0 additions & 5 deletions spec/mongoid/persistable/savable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,6 @@
expect(truck.crates[0].toys[0].name).to eq "Teddy bear"
expect(truck.crates[1].volume).to eq 0.8
expect(truck.crates[1].toys.size).to eq 0

# TODO: MONGOID-5026: combine the updates so that there are
# no conflicts.
#expect(truck.atomic_updates[:conflicts]).to eq nil

expect { truck.save! }.not_to raise_error

_truck = Truck.find(truck.id)
Expand Down

0 comments on commit 0c85796

Please sign in to comment.