Skip to content

Commit 0c85796

Browse files
MONGOID-5026 - Remove code comments and close ticket (#5605)
* Close MONGOID-5026 * Update updatable.rb
1 parent ca3c6a5 commit 0c85796

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

lib/mongoid/persistable/updatable.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,15 @@ def update_document(options = {})
129129
unless updates.empty?
130130
coll = collection(_root)
131131
selector = atomic_selector
132+
133+
# TODO: DRIVERS-716: If a new "Bulk Write" API is introduced, it may
134+
# become possible to handle the writes for conflicts in the following call.
132135
coll.find(selector).update_one(positionally(selector, updates), session: _session)
133136

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

144143
# Group the changes according to their root key which is

spec/mongoid/persistable/savable_spec.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@
295295
expect(truck.crates[0].toys[0].name).to eq "Teddy bear"
296296
expect(truck.crates[1].volume).to eq 0.8
297297
expect(truck.crates[1].toys.size).to eq 0
298-
299-
# TODO: MONGOID-5026: combine the updates so that there are
300-
# no conflicts.
301-
#expect(truck.atomic_updates[:conflicts]).to eq nil
302-
303298
expect { truck.save! }.not_to raise_error
304299

305300
_truck = Truck.find(truck.id)

0 commit comments

Comments
 (0)