mongoid-locking 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/Gemfile.lock +2 -2
- data/Rakefile +1 -1
- data/lib/mongoid/locking/persistable/updatable.rb +7 -9
- data/lib/mongoid/locking/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d0e6fc6d5ee935327d525147b776e047a02c7a6e5d3333511c7970b9f3134e4
|
4
|
+
data.tar.gz: 82e6e6b8a51e311e8ce893ea90d33b0d484aef129dc8f119b0e3999fcc78e6d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98a30ae0a41505c9aefe8f9cf5d66e6412952e170c8c82fdfa158a785f5f523784fbdb1b288337430d6215eab72648a02b0789ba4d21b4f70d033b0c6928aa47
|
7
|
+
data.tar.gz: 7ce149336c4e7bff291ab3664af449e5d582e51124abda696e44e578d75745548c74c14361a52765bc8b99f9fd2283e49c2a90f2543772ab3378f92db9cb5255
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
@@ -9,15 +9,13 @@ module Mongoid
|
|
9
9
|
def update_document(options = {})
|
10
10
|
prepare_update(options) do
|
11
11
|
updates, conflicts = init_atomic_updates
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
conflicts.each_pair do |key, value|
|
20
|
-
coll.find(selector).update_one(positionally(selector, { key => value }), session: _session)
|
12
|
+
unless updates.empty?
|
13
|
+
coll = collection(_root)
|
14
|
+
selector = atomic_selector
|
15
|
+
_update_one_locked(coll, selector, updates)
|
16
|
+
conflicts.each_pair do |key, value|
|
17
|
+
coll.find(selector).update_one(positionally(selector, { key => value }), session: _session)
|
18
|
+
end
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|