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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0484d3a5e2c66cc3a052ddf7b84a77fb976062c1b8e4cff8aabf07606708917f'
4
- data.tar.gz: e0c48bf52a2c6172f9aeef7cd65a90d766d648249d2d4c64463cc34541e85e63
3
+ metadata.gz: 4b3882c55b3e657ad75fb0cabf586ae890506ba89acc34a198d32c31c2aa8521
4
+ data.tar.gz: e8a3ffa61736d782745416743cf926daf2170be8beee94189adf9bf962515fd5
5
5
  SHA512:
6
- metadata.gz: 37200c924df3d9e7a7ce7ab32aba09f1e3dcda62e505eee98ad0b35239dbe26264b17402612d85ec97169ae4d678e484227812195b5d5db4aa3d96a647ff09bd
7
- data.tar.gz: 549596a8a3c6fe27297b746f92a1d2ed787c4d48405a12b9e0d10134ecd38aa8b326cc5d0f9065c1bc117cb416862322d1ce1fbabab700a3856a20943b1f9944
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.0"
6
+ gem "rake", "~> 13.3"
7
7
 
8
- gem "minitest", "~> 5.0"
9
- gem "minitest-hooks", "~> 1.5.1"
10
- gem "mocha", "~> 2.1.0"
8
+ gem "minitest", "~> 6.0"
9
+ gem "minitest-hooks", "~> 1.5.3"
10
+ gem "mocha", "~> 3.0.1"
11
11
 
12
- gem "standard", "~> 1.3"
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
- if ENV["RAILS_VERSION"] &&
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.5.5"
23
+ gem "pg", "~> 1.6.3"
29
24
  else
30
- gem "mysql2", "~> 0.5.6"
25
+ gem "mysql2", "0.5.6"
31
26
  end
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Positioning
2
2
 
3
+ [![Ruby](https://github.com/brendon/positioning/actions/workflows/main.yml/badge.svg)](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 == scope_column
225
+ Array(@positioned.destroyed_by_association.foreign_key).include?(scope_column)
226
226
  end
227
227
  end
228
228
  end
@@ -1,3 +1,3 @@
1
1
  module Positioning
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
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] << reflection.foreign_key
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.7
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: 1980-01-02 00:00:00.000000000 Z
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.7.1
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: []