mongoid-locking 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6150316b83b781d4f26eff62a82a593aff8f7a7a81791ae7b003801e9cc2f44
4
- data.tar.gz: 57a84b81757d94e4d4bfaceaea0f98f8437bd61bf7832be9e030fcb37fd5146c
3
+ metadata.gz: d7295a06524fd71fe15ceb6891b452cbd698459e7ebd9105dcad9b36fd438952
4
+ data.tar.gz: 241baea11c9c0bd16525f94d72d3358ea5eeae2cd1f24d9a715bdc5cb085b5dc
5
5
  SHA512:
6
- metadata.gz: 743b07e99b92af64d0d209580f2a5851c44800a51c7c33e794cc655661abfeb86c65e1f8df66cd7eb42197466020cae038c85dd9dfd2656b7e187204cddcd3a1
7
- data.tar.gz: c14fb5d640c3bf4b6a4edfab3929aae1244a13f62ebe40641bd5a7a354357203f8f7e8add1e396ca07917d57cc3f4fd9af3ea3f3b5d589c3ceef17fa595de043
6
+ metadata.gz: 2c109c5fcbe7110c1b2c7507e3bf651f72659639b5b39b1e91acdf07997ffc772661ac627ab3a9c46ebeb4cdd4b119440724d9de6ab8f0507ee8e2d20b59e248
7
+ data.tar.gz: eed71b3a4074bbdd5a9753317d12f39a0bbc56879f523a71d209547e1270e0a29d7fe4007b8e1b18831d1d6f66ee9a9c38f74964a0ddc49a3cff1b86a8136993
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongoid-locking (1.0.0)
5
- mongoid (~> 7.2.0)
4
+ mongoid-locking (1.1.1)
5
+ mongoid (~> 7.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -77,7 +77,7 @@ PLATFORMS
77
77
 
78
78
  DEPENDENCIES
79
79
  byebug
80
- mongoid (~> 7.2.0)
80
+ mongoid (~> 7.2)
81
81
  mongoid-locking!
82
82
  rake (~> 13.0)
83
83
  rspec
data/README.md CHANGED
@@ -62,4 +62,4 @@ Everyone interacting in the Mongoid::Locking project's codebases, issue trackers
62
62
  | -------- | ------- |
63
63
  | 0.1.2 | >= 6.0, < 7.2 |
64
64
  | 1.0.0 | ~> 7.2.0 |
65
- | 1.1.0 | ~> 7.2 |
65
+ | ~> 1.1.0 | ~> 7.2 |
@@ -0,0 +1,29 @@
1
+ module Mongoid
2
+ module Locking
3
+ module Association
4
+ module Embedded
5
+ module Batchable # :nodoc:
6
+ # Get the selector for executing atomic operations on the collection.
7
+ #
8
+ # @api private
9
+ #
10
+ # @example Get the selector.
11
+ # batchable.selector
12
+ #
13
+ # @return [ Hash ] The atomic selector.
14
+ #
15
+ # @since 3.0.0
16
+ #
17
+ # ---
18
+ #
19
+ # Mongoid memoizes the atomic selector, which is not compatible with
20
+ # Mongoid::Locking. For subsequent saves, the lock_version needs to be
21
+ # updated, so the atomic selector needs to be regenerated.
22
+ def selector
23
+ _base.atomic_selector
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mongoid
4
4
  module Locking
5
- VERSION = "1.1.0"
5
+ VERSION = "1.1.1"
6
6
  end
7
7
  end
@@ -1,6 +1,7 @@
1
1
  require "mongoid"
2
2
  require_relative "locking/version"
3
3
  require_relative "stale_object_error"
4
+ require_relative "locking/association/embedded/batchable"
4
5
  require_relative "locking/contextual/atomic"
5
6
  require_relative "locking/contextual/mongo"
6
7
  require_relative "locking/selectable"
@@ -30,5 +31,8 @@ end
30
31
  Mongoid::Contextual::Mongo.prepend Mongoid::Locking::Contextual::Mongo
31
32
  Mongoid::Contextual::Mongo.prepend Mongoid::Locking::Contextual::Atomic
32
33
 
34
+ # monkey patching for embedded documents
35
+ Mongoid::Association::Embedded::Batchable.prepend Mongoid::Locking::Association::Embedded::Batchable
36
+
33
37
  # monkey patching for document updates
34
38
  Mongoid::Persistable.prepend Mongoid::Locking::Persistable
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-locking
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo RA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-17 00:00:00.000000000 Z
11
+ date: 2023-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -114,6 +114,7 @@ files:
114
114
  - gemfiles/mongoid7_2.gemfile
115
115
  - gemfiles/mongoid7_3.gemfile
116
116
  - lib/mongoid/locking.rb
117
+ - lib/mongoid/locking/association/embedded/batchable.rb
117
118
  - lib/mongoid/locking/contextual/atomic.rb
118
119
  - lib/mongoid/locking/contextual/mongo.rb
119
120
  - lib/mongoid/locking/persistable.rb