positioning 0.4.4 → 0.4.5

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: 0713523ffe6c61e11bf14cf8a26b4285d9679fdd795b8c90c4a3cd65ae999996
4
- data.tar.gz: 6f84c58171c950578ec96e51ce251a3839c06b0d23a906f9bac4e1282341e5b5
3
+ metadata.gz: 276386e9beb6287e8a41c53eb5dd126a32026c925efbd4747e4a3350ad42b324
4
+ data.tar.gz: b547a1e30050859c4a85a51f3853a94c04e9c959405f206578dccf264ee91c23
5
5
  SHA512:
6
- metadata.gz: ba04ca78b1c80fdd53cc0eff2aff8486a35f39c7d5c6d580a4bd5f3a79f41449e4a4b40582d83b2a683805b6d2b7f60d71cedecc6d3385c2bb602830589fc4f6
7
- data.tar.gz: f8cba117e4cd9acac2172f3d7643e77f59006345e1ea29581dc4434d86b972998230c8532f99f4ae50c7c995f634c05394631522819706a4addf0a5af559d5a0
6
+ metadata.gz: '0827cf02ca0e2613eff985b05a05fd047b814245cccf4a4eb6af202726fe2768851b5f06abcf1dbd21362d99ccfc5e244ee6db46af3d7cc597ff060d1faa4cb0'
7
+ data.tar.gz: 7a8852c7ac8cdd0a4f334492eda3dd63cf8275410bb41b39d9616b9297cd97fdac2c6f30832b40f1c4faf67c5a0133afae63596f97dd527a831cf8054c6239a7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.5] - 2024-12-04
4
+
5
+ - Fix healing a list with a default scope `:order` and/or `:select`. Thanks @LukasSkywalker!
6
+
3
7
  ## [0.4.4] - 2024-11-20
4
8
 
5
9
  - Add `funding_uri` to gemspec.
@@ -8,7 +8,7 @@ module Positioning
8
8
 
9
9
  def heal
10
10
  if scope_columns.present?
11
- @model.select(*scope_columns).distinct.each do |scope_record|
11
+ @model.unscope(:order).reselect(*scope_columns).distinct.each do |scope_record|
12
12
  @model.transaction do
13
13
  if scope_associations.present?
14
14
  scope_associations.each do |scope_association|
@@ -40,7 +40,7 @@ module Positioning
40
40
  end
41
41
 
42
42
  def sequence(scope)
43
- scope.reorder(@order).each.with_index(1) do |record, index|
43
+ scope.unscope(:select).reorder(@order).each.with_index(1) do |record, index|
44
44
  record.update_columns @column => index
45
45
  end
46
46
  end
@@ -1,3 +1,3 @@
1
1
  module Positioning
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
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
4
+ version: 0.4.5
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-19 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport