mongoid-locking 1.0.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: 1be989a2d87d54412d3eafa95e4aeedb1bf9d0d97d5db712c5fdc190bc4f45ec
4
- data.tar.gz: 8fea7cc8a65b2b331f7e692025e3cc0690a686024efb2d5e89528dc8205951cb
3
+ metadata.gz: d7295a06524fd71fe15ceb6891b452cbd698459e7ebd9105dcad9b36fd438952
4
+ data.tar.gz: 241baea11c9c0bd16525f94d72d3358ea5eeae2cd1f24d9a715bdc5cb085b5dc
5
5
  SHA512:
6
- metadata.gz: cac9e7692341645f57ab69863a724fac9773754f7f323bdf0e9c17cf311475a361d45c7495d1fc7db8e6784f71958b157d5f53edabde1dda6c1f569827955d40
7
- data.tar.gz: ead4b76df6e9a5b8341bc8f842519f9545cea89ec6ffb00f25d4217881c16a757f85dfacc41f3fb1f571f501d831e7f959bef1c407d0a6be0312c7e74d6ee5c9
6
+ metadata.gz: 2c109c5fcbe7110c1b2c7507e3bf651f72659639b5b39b1e91acdf07997ffc772661ac627ab3a9c46ebeb4cdd4b119440724d9de6ab8f0507ee8e2d20b59e248
7
+ data.tar.gz: eed71b3a4074bbdd5a9753317d12f39a0bbc56879f523a71d209547e1270e0a29d7fe4007b8e1b18831d1d6f66ee9a9c38f74964a0ddc49a3cff1b86a8136993
data/Gemfile CHANGED
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in mongoid-locking.gemspec
6
6
  gemspec
7
7
 
8
- gem "mongoid", "~> 7.2.0"
8
+ gem "mongoid", "~> 7.2"
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
@@ -58,7 +58,8 @@ Everyone interacting in the Mongoid::Locking project's codebases, issue trackers
58
58
 
59
59
  ## Version Compability
60
60
 
61
- | Gem version | Mongoid version | Ruby version |
62
- | -------- | ------- | ------- |
63
- | 0.1.2 | >= 6.0, < 7.2 | => 2.6 |
64
- | 1.0.0 | ~> 7.2 | => 3.0 |
61
+ | Gem version | Mongoid version |
62
+ | -------- | ------- |
63
+ | 0.1.2 | >= 6.0, < 7.2 |
64
+ | 1.0.0 | ~> 7.2.0 |
65
+ | ~> 1.1.0 | ~> 7.2 |
@@ -3,4 +3,4 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in mongoid-locking.gemspec
4
4
  gemspec path: ".."
5
5
 
6
- gem "mongoid", "~> 7.2"
6
+ gem "mongoid", "~> 7.2.0"
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in mongoid-locking.gemspec
4
+ gemspec path: ".."
5
+
6
+ gem "mongoid", "~> 7.3.0"
@@ -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.0.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.0.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-15 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
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 7.2.0
19
+ version: '7.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 7.2.0
26
+ version: '7.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -111,8 +111,10 @@ files:
111
111
  - LICENSE.txt
112
112
  - README.md
113
113
  - Rakefile
114
- - gemfiles/mongoid7.gemfile
114
+ - gemfiles/mongoid7_2.gemfile
115
+ - gemfiles/mongoid7_3.gemfile
115
116
  - lib/mongoid/locking.rb
117
+ - lib/mongoid/locking/association/embedded/batchable.rb
116
118
  - lib/mongoid/locking/contextual/atomic.rb
117
119
  - lib/mongoid/locking/contextual/mongo.rb
118
120
  - lib/mongoid/locking/persistable.rb