forest_liana 9.22.7 → 9.22.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: 1899aa8f55f2188189973046573741eb4492ad3e47c8bac900125d7468cc1845
4
- data.tar.gz: 8fe15b7c2eaca28fa7c74ad66af35eecc7299dcea6f0671b8e07fa36f07529cd
3
+ metadata.gz: 16535336fcd20313742ad4fc2bc231e159157d00f75fbb5a7cddb326be28507e
4
+ data.tar.gz: e8f7d86078eb9d1b19b0c5fb923c26d144605914f556204c54ac631c8a84421c
5
5
  SHA512:
6
- metadata.gz: d5c3b883ebdc5412f0a982b5cd12d23e361163471e5cbe39bc6e7ca956672f8a34ef06eb41300279ce0ac9ca79aab26f28377539e9ada69cf39f8716b17323d3
7
- data.tar.gz: 320775ad84781e8b15a27b5cffa365975afa2da9e4d59317bf6bdf2cd9978951eac6b0671e989b6201203df37bc1450e349cd171a4eaf799d6f5a94a28ed56bc
6
+ metadata.gz: f30b96a77ac786bda68265d8e8f4684a3141747e76096251c5c52f7f95883cb6539072bcb97bbdb796796e3292da67c8541ba7f454d1e6a359770833c5aa1c7b
7
+ data.tar.gz: ec0e110843449b24f2fd4af2aae10b1ef43282ad01a7000de729e7dbaa135adb1eb7d490d71d4e5d06dad8adb110ea1f94843506f9984515e43657ff3536864a
@@ -168,7 +168,9 @@ module ForestLiana
168
168
  return [] unless @params.dig(:fields, @collection_name)
169
169
 
170
170
  associations_for_query = extract_associations_from_filter
171
- associations_for_query << @params[:sort].split('.').first.to_sym if @params[:sort]&.include?('.')
171
+ @params[:sort]&.split(',')&.each do |sort_field|
172
+ associations_for_query << sort_field.delete_prefix('-').split('.').first.to_sym if sort_field.include?('.')
173
+ end
172
174
  @fields_to_serialize | associations_for_query
173
175
  end
174
176
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "9.22.7"
2
+ VERSION = "9.22.8"
3
3
  end
@@ -258,6 +258,19 @@ module ForestLiana
258
258
  end
259
259
  end
260
260
 
261
+ describe 'when sorting by a belongs_to association after another field' do
262
+ let(:resource) { Tree }
263
+ let(:fields) { { resource.name => 'id' } }
264
+ let(:sort) { 'id,-owner.name' }
265
+
266
+ it 'should load the association of the sort on a relation' do
267
+ getter.perform
268
+
269
+ expect(getter.includes).to contain_exactly(:owner)
270
+ expect(getter.records.map(&:id)).to eq [1, 2, 3, 4, 5]
271
+ end
272
+ end
273
+
261
274
  describe 'when sorting by a has_one association' do
262
275
  let(:resource) { Island }
263
276
  let(:sort) { 'location.coordinates' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.22.7
4
+ version: 9.22.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-05 00:00:00.000000000 Z
11
+ date: 2026-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails