jpie 4.1.4.pre.202610200314 → 4.1.4

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: 99a417d6c962a3cb24d7f4a23fb7885c9b7f926e90581dc627ca4e49eedf3e12
4
- data.tar.gz: 0b2c7e1a3a46cb121fee88016e2973c434e810ee77a457d74c9af801061920dd
3
+ metadata.gz: eb96ac4995c6800cd07f48cd102d03820072ca58b8f1db35fcc54dece961a281
4
+ data.tar.gz: 7dfa2d854082e1b4848b94230a0ae06606751019c0b239308c4f57dc14027a7b
5
5
  SHA512:
6
- metadata.gz: 7919cbc31afc76d20690299f09c1d43338296cb0c62aa434b62ee5b333fc8fc76264dc131964d8ce8071a6829f9341c15fbf1c8d834cefba36898b38bee63a16
7
- data.tar.gz: ee1c5a2cb143e8a2027ca269734aae1d43c7f031129c59e32908bd9d6c10cb069e53c304b8eadf03cbfdc061fff391594cc4a0ae041272f0f89b4c5aa8e978bb
6
+ metadata.gz: 2e87c64831d1acbeaa40a4d0d91e2741e0d34c30585903ef7fe7d266daaa0359078549592eb1ae516a4dab9879a2d5e2e45b59ba452e797d4a6f3fe4014714c8
7
+ data.tar.gz: f4dba819c5a1e0b04997e623ce83bf568050e80842b93a75547b02be2232813d9f0f060cfb643d50c693c66bacf7785ae4fc071863748bd4241e5f7ff71460e7
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ at release time.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.1.4] - 2026-11-10
11
+
12
+ ### Fixed
13
+
14
+ - **Vet an STI include once for the base class.** The include filter vets
15
+ record ids under the class the association reads, the base class of an STI
16
+ tree. The warm step grouped the loaded records by their own subclass, so
17
+ the warm work was lost and the serializer ran its own query for each
18
+ parent. The warm step now uses the association class. An include of an STI
19
+ association costs one vetting query for the whole page. Regression spec:
20
+ `include_filter_sti_base_class_spec.rb`.
21
+
10
22
  ## [4.1.3] - 2026-10-10
11
23
 
12
24
  ### Fixed
@@ -71,9 +71,18 @@ module JSONAPI
71
71
  cache
72
72
  end
73
73
 
74
+ # The serializer vets a hop under the class its association reads, which
75
+ # is the base class of an STI tree. Warm under that same class, so both use
76
+ # one key, and warm once per class so the page size does not set the
77
+ # query count.
74
78
  def warm_include_level(cache, records, association_name)
75
- targets = records.flat_map { |record| loaded_association_targets(record, association_name) }
76
- targets.group_by(&:class).each { |klass, recs| cache.warm(klass, recs.filter_map(&:id)) }
79
+ ids_by_klass = Hash.new { |hash, klass| hash[klass] = [] }
80
+ targets = records.flat_map do |record|
81
+ found = loaded_association_targets(record, association_name)
82
+ ids_by_klass[record.association(association_name).klass].concat(found.filter_map(&:id)) if found.any?
83
+ found
84
+ end
85
+ ids_by_klass.each { |klass, ids| cache.warm(klass, ids) }
77
86
  targets
78
87
  end
79
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JSONAPI
4
- VERSION = "4.1.4.pre.202610200314"
4
+ VERSION = "4.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jpie
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.4.pre.202610200314
4
+ version: 4.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Kampp