positioning 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/lib/positioning/mechanisms.rb +6 -4
- data/lib/positioning/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf799b4590dc7a86e63c7ba46fe624bd7c6353989a6d33833942b30dd0c5bd46
|
4
|
+
data.tar.gz: 773a8c4b1f0cc6d528577c8d5c8f0263e310a5e8e3f2e69beeeaf9265e063dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50423eee7719178be13087622bcc14b4a9e74974bdb0685fe7281838cc7cca8f784251b81a28d92e848a2b2eb7b79e4081a3ad4043ed483200f51341c71bf82f
|
7
|
+
data.tar.gz: e2ccbac3a7d0994e997a0b17907becc017893d5355fa9c06a745828b8ec90661076332e9ef1769bd9c0f6c1f8ba808e3d209e0f56b9acdf33d4e1ba6e5d9bd88
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [0.4.
|
3
|
+
## [0.4.2] - 2024-11-08
|
4
|
+
|
5
|
+
NOTE: Versions 0.4.0 and 0.4.1 contain fatal flaws with the locking logic. Upgrade as soon as you can.
|
6
|
+
|
7
|
+
- Fix cases where locking wasn't executed where there were no associated scopes.
|
8
|
+
- Fix locking causing the in-memory record to be reloaded from the database. We only need the lock, not the reloaded record.
|
9
|
+
|
10
|
+
## [0.4.1] - 2024-11-07
|
4
11
|
|
5
12
|
- Fix locking where a `belongs_to` association is `optional: true`.
|
6
13
|
|
7
|
-
## [0.4.0] - 2024-
|
14
|
+
## [0.4.0] - 2024-11-07
|
8
15
|
|
9
16
|
- BREAKING CHANGE: Advisory Lock has been removed. If you explicitly define `advisory_lock: false` in your `positioned` call, you'll need to remove this.
|
10
17
|
- CAUTION: The Advisory Lock replacement is row locking. Where `belongs_to` associations exist, we lock the associated record(s), and that limits the locking scope down to the record's current scope, and potentially the scope it belonged to before a change in scope. If there are no `belongs_to` associations then the records that belong to the current (and potentially new) scope are locked, or all the records in the table are locked if there is no scope. Please report any deadlock issues.
|
@@ -192,17 +192,19 @@ module Positioning
|
|
192
192
|
if scope_associations.present?
|
193
193
|
scope_associations.each do |scope_association|
|
194
194
|
if @positioned.persisted? && positioning_scope_changed?
|
195
|
-
record_scope.first.send(scope_association)
|
195
|
+
associated_record = record_scope.first.send(scope_association)
|
196
|
+
associated_record.class.base_class.lock.find(associated_record.id) if associated_record
|
196
197
|
end
|
197
198
|
|
198
|
-
@positioned.send(scope_association)
|
199
|
+
associated_record = @positioned.send(scope_association)
|
200
|
+
associated_record.class.base_class.lock.find(associated_record.id) if associated_record
|
199
201
|
end
|
200
202
|
else
|
201
203
|
if @positioned.persisted? && positioning_scope_changed?
|
202
|
-
positioning_scope_was.lock
|
204
|
+
positioning_scope_was.lock.all.load
|
203
205
|
end
|
204
206
|
|
205
|
-
positioning_scope.lock
|
207
|
+
positioning_scope.lock.all.load
|
206
208
|
end
|
207
209
|
end
|
208
210
|
|
data/lib/positioning/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: positioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brendon Muir
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|