positioning 0.4.7 → 0.4.8
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/Gemfile +8 -13
- data/README.md +3 -1
- data/lib/positioning/mechanisms.rb +1 -1
- data/lib/positioning/version.rb +1 -1
- data/lib/positioning.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b3882c55b3e657ad75fb0cabf586ae890506ba89acc34a198d32c31c2aa8521
|
|
4
|
+
data.tar.gz: e8a3ffa61736d782745416743cf926daf2170be8beee94189adf9bf962515fd5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77acd60a82aef76786848043aeebe7ed58e1f6725592ef21ff0265eed16d1fdc4fd52024988b4e86e7537c990e6f6f1be8c6bb7392250a30dee8901ead8b3179
|
|
7
|
+
data.tar.gz: ff80e90b8ed3d4d96f24f26c879a0fb4d570d92b22c4159ecc79683e9f56b39df46c0cb524a7a478781905a3e46bdc44012f6cca7d959f9b0d226f69de67d33d
|
data/Gemfile
CHANGED
|
@@ -3,13 +3,13 @@ source "https://rubygems.org"
|
|
|
3
3
|
# Specify your gem's dependencies in positioning.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
-
gem "rake", "~> 13.
|
|
6
|
+
gem "rake", "~> 13.3"
|
|
7
7
|
|
|
8
|
-
gem "minitest", "~>
|
|
9
|
-
gem "minitest-hooks", "~> 1.5.
|
|
10
|
-
gem "mocha", "~>
|
|
8
|
+
gem "minitest", "~> 6.0"
|
|
9
|
+
gem "minitest-hooks", "~> 1.5.3"
|
|
10
|
+
gem "mocha", "~> 3.0.1"
|
|
11
11
|
|
|
12
|
-
gem "standard", "~> 1.
|
|
12
|
+
gem "standard", "~> 1.52.0"
|
|
13
13
|
|
|
14
14
|
if ENV["RAILS_VERSION"]
|
|
15
15
|
gem "activerecord", ENV["RAILS_VERSION"]
|
|
@@ -18,14 +18,9 @@ end
|
|
|
18
18
|
|
|
19
19
|
case ENV["DB"]
|
|
20
20
|
when "sqlite"
|
|
21
|
-
|
|
22
|
-
Gem::Version.new(ENV["RAILS_VERSION"]) >= Gem::Version.new("7.2")
|
|
23
|
-
gem "sqlite3", "~> 2.2.0"
|
|
24
|
-
else
|
|
25
|
-
gem "sqlite3", "~> 1.7.2"
|
|
26
|
-
end
|
|
21
|
+
gem "sqlite3", "~> 2.9.0"
|
|
27
22
|
when "postgresql"
|
|
28
|
-
gem "pg", "~> 1.
|
|
23
|
+
gem "pg", "~> 1.6.3"
|
|
29
24
|
else
|
|
30
|
-
gem "mysql2", "
|
|
25
|
+
gem "mysql2", "0.5.6"
|
|
31
26
|
end
|
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Positioning
|
|
2
2
|
|
|
3
|
+
[](https://github.com/brendon/positioning/actions/workflows/main.yml)
|
|
4
|
+
|
|
3
5
|
The aim of this gem is to allow you to easily position Active Record model instances within a scope of your choosing. In an ideal world this gem will give your model instances sequential integer positions beginning with `1`. Attempts are made to make all changes within a transaction so that position integers remain consistent. To this end, directly assigning a position is discouraged, instead you can move items by declaring an item's prior or subsequent item in the list and your item will be moved to be relative to that item.
|
|
4
6
|
|
|
5
7
|
Positioning supports multiple lists per model with global, simple, and complex scopes.
|
|
@@ -274,7 +276,7 @@ If you must position child models separately, scope their position by the `type`
|
|
|
274
276
|
|
|
275
277
|
```rb
|
|
276
278
|
positioned on: [:type]
|
|
277
|
-
```
|
|
279
|
+
```
|
|
278
280
|
|
|
279
281
|
## Concurrency
|
|
280
282
|
|
|
@@ -222,7 +222,7 @@ module Positioning
|
|
|
222
222
|
|
|
223
223
|
def destroyed_via_positioning_scope?
|
|
224
224
|
@positioned.destroyed_by_association && scope_columns.any? do |scope_column|
|
|
225
|
-
@positioned.destroyed_by_association.foreign_key
|
|
225
|
+
Array(@positioned.destroyed_by_association.foreign_key).include?(scope_column)
|
|
226
226
|
end
|
|
227
227
|
end
|
|
228
228
|
end
|
data/lib/positioning/version.rb
CHANGED
data/lib/positioning.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Positioning
|
|
|
35
35
|
reflection = reflections[scope_component]
|
|
36
36
|
|
|
37
37
|
if reflection&.belongs_to?
|
|
38
|
-
positioning_columns[column][:scope_columns]
|
|
38
|
+
positioning_columns[column][:scope_columns].concat Array(reflection.foreign_key)
|
|
39
39
|
positioning_columns[column][:scope_columns] << reflection.foreign_type if reflection.polymorphic?
|
|
40
40
|
positioning_columns[column][:scope_associations] << reflection.name
|
|
41
41
|
else
|
metadata
CHANGED
|
@@ -1,13 +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.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brendon Muir
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-03-28 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: activesupport
|
|
@@ -37,6 +38,7 @@ dependencies:
|
|
|
37
38
|
- - ">="
|
|
38
39
|
- !ruby/object:Gem::Version
|
|
39
40
|
version: '6.1'
|
|
41
|
+
description:
|
|
40
42
|
email:
|
|
41
43
|
- brendon@spike.net.nz
|
|
42
44
|
executables: []
|
|
@@ -63,6 +65,7 @@ metadata:
|
|
|
63
65
|
source_code_uri: https://github.com/brendon/positioning
|
|
64
66
|
changelog_uri: https://github.com/brendon/positioning/blob/main/CHANGELOG.md
|
|
65
67
|
funding_uri: https://github.com/sponsors/brendon
|
|
68
|
+
post_install_message:
|
|
66
69
|
rdoc_options: []
|
|
67
70
|
require_paths:
|
|
68
71
|
- lib
|
|
@@ -77,7 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
77
80
|
- !ruby/object:Gem::Version
|
|
78
81
|
version: '0'
|
|
79
82
|
requirements: []
|
|
80
|
-
rubygems_version: 3.
|
|
83
|
+
rubygems_version: 3.5.22
|
|
84
|
+
signing_key:
|
|
81
85
|
specification_version: 4
|
|
82
86
|
summary: Simple positioning for Active Record models.
|
|
83
87
|
test_files: []
|