positioning 0.2.1 → 0.2.2
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 +4 -1
- data/lib/positioning/version.rb +1 -1
- data/lib/positioning.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: 9e6d1d78422ff0b404f4a6c0d38d4bd8bce62600e322e7ba4d67cd6caf781fac
|
4
|
+
data.tar.gz: 0625ae933d5eab6bc6bf0d9cc1b510b37c0b8ad29657260b90c08f79a51ef2bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 052bfedb7143dcec3259f9f16beaa0102c34b6a268d1599f103ce70dd04bac9c8dfb507820137d0c035ef0ab730cba7dcf77fe0060b7cc4c0902aea3093e40ef
|
7
|
+
data.tar.gz: fba0dc8f0583588f127d4755b3a03f03ed0e39b9c9f5badafc6b3637d27e37084860df2cbe9c553d01f23452a9437302714c415049eb6764c82a30a9b904ff4d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.2] - 2024-05-17
|
4
|
+
|
5
|
+
- When destroying a positioned item, first move it out of the way (position = 0) then contract the scope. Do this before destruction. Moving the item out of the way memoizes its original position to cope with the case where multiple items are destroyed with `destroy_all` as they'll have their position column cached. Thanks @james-reading for the report.
|
6
|
+
|
3
7
|
## [0.2.1] - 2024-04-08
|
4
8
|
|
5
9
|
- Fetch the adapter_name from #connection_db_config (@tijn)
|
@@ -39,7 +39,10 @@ module Positioning
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def destroy_position
|
42
|
-
|
42
|
+
unless destroyed_via_positioning_scope?
|
43
|
+
move_out_of_the_way
|
44
|
+
contract(positioning_scope, (position_was + 1)..)
|
45
|
+
end
|
43
46
|
end
|
44
47
|
|
45
48
|
private
|
data/lib/positioning/version.rb
CHANGED
data/lib/positioning.rb
CHANGED
@@ -51,7 +51,7 @@ module Positioning
|
|
51
51
|
|
52
52
|
before_create { Mechanisms.new(self, column).create_position }
|
53
53
|
before_update { Mechanisms.new(self, column).update_position }
|
54
|
-
|
54
|
+
before_destroy { Mechanisms.new(self, column).destroy_position }
|
55
55
|
|
56
56
|
after_commit advisory_lock
|
57
57
|
after_rollback advisory_lock
|
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.2.
|
4
|
+
version: 0.2.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
|
+
date: 2024-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|