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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16535336fcd20313742ad4fc2bc231e159157d00f75fbb5a7cddb326be28507e
|
|
4
|
+
data.tar.gz: e8f7d86078eb9d1b19b0c5fb923c26d144605914f556204c54ac631c8a84421c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
|
data/lib/forest_liana/version.rb
CHANGED
|
@@ -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.
|
|
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-
|
|
11
|
+
date: 2026-10-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|