positioning 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/positioning/mechanisms.rb +9 -3
- data/lib/positioning/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: fdc57e74504d876181c7f4b4355f4a3b2831bb8da768164fa4ff6aaf00655164
|
4
|
+
data.tar.gz: ed8daeb88c81490abfc233e9c853b19dd38da72e7ec5c05648cc4e221dbab62e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ebe0ebd308d7937b6838d819e64bf8ce3728bf938c2c69b123c264cd351b8f6a20e66406abcda68c091ef4a6fdb270b638eccab0310eb1776ca8bd06ba7bded
|
7
|
+
data.tar.gz: edcfe4c7f0ca38e6660f956910c6f7d6a70430ffe6949bb098c28ba37d95aaafc33cacdfd3e002a6384fb43c84e9c625b2cbf8498a541cc850bf9e9a9e85bf69
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.4.1] - 2024-10-12
|
4
|
+
|
5
|
+
- Fix locking where a `belongs_to` association is `optional: true`.
|
6
|
+
|
3
7
|
## [0.4.0] - 2024-10-12
|
4
8
|
|
5
9
|
- BREAKING CHANGE: Advisory Lock has been removed. If you explicitly define `advisory_lock: false` in your `positioned` call, you'll need to remove this.
|
@@ -191,11 +191,17 @@ module Positioning
|
|
191
191
|
def lock_positioning_scope!
|
192
192
|
if scope_associations.present?
|
193
193
|
scope_associations.each do |scope_association|
|
194
|
-
|
195
|
-
|
194
|
+
if @positioned.persisted? && positioning_scope_changed?
|
195
|
+
record_scope.first.send(scope_association)&.lock!
|
196
|
+
end
|
197
|
+
|
198
|
+
@positioned.send(scope_association)&.lock!
|
196
199
|
end
|
197
200
|
else
|
198
|
-
|
201
|
+
if @positioned.persisted? && positioning_scope_changed?
|
202
|
+
positioning_scope_was.lock!
|
203
|
+
end
|
204
|
+
|
199
205
|
positioning_scope.lock!
|
200
206
|
end
|
201
207
|
end
|
data/lib/positioning/version.rb
CHANGED