forest_admin_datasource_customizer 1.0.0.pre.beta.75 → 1.0.0.pre.beta.76
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: ec0291e3a471fa36686b1b840a374ac749683e326b348138407b06c809d92127
|
|
4
|
+
data.tar.gz: b8fe6d62d4a46f8ce072a9547e6d6f2bef0889a3fa9dcc2e041182f9f99ae542
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 123afdc034a99235250f9e8fa23df824f786ef8be242340f0a6463acfa6e99f133fff4c6d0970915f96827bbfedff3d3c2942f6be675bd67999de4ecffaf1d75
|
|
7
|
+
data.tar.gz: 1b553a2b4290d6b49c5b4f070b22b934f86f13f8f6dada6333a82609f4177d73282448402941f30ecf857994ae9143e27f143e2509190af73b93428f15cd2dd7
|
data/lib/forest_admin_datasource_customizer/decorators/relation/relation_collection_decorator.rb
CHANGED
|
@@ -243,9 +243,9 @@ module ForestAdminDatasourceCustomizer
|
|
|
243
243
|
association = datasource.get_collection(field_schema.foreign_collection)
|
|
244
244
|
|
|
245
245
|
if !@relations[name]
|
|
246
|
-
association.re_project_in_place(caller, records.
|
|
246
|
+
association.re_project_in_place(caller, records.filter_map { |r| r[name] }, projection)
|
|
247
247
|
elsif field_schema.type == 'ManyToOne'
|
|
248
|
-
ids = records.
|
|
248
|
+
ids = records.filter_map { |record| record[field_schema.foreign_key] }.uniq
|
|
249
249
|
sub_filter = Filter.new(condition_tree: ConditionTreeLeaf.new(field_schema.foreign_key_target, 'In', ids))
|
|
250
250
|
sub_records = association.list(caller, sub_filter, projection.union([field_schema.foreign_key_target]))
|
|
251
251
|
|
|
@@ -253,7 +253,7 @@ module ForestAdminDatasourceCustomizer
|
|
|
253
253
|
record[name] = sub_records.find { |sr| sr[field_schema.foreign_key_target] == record[field_schema.foreign_key] }
|
|
254
254
|
end
|
|
255
255
|
elsif field_schema.type == 'OneToOne' || field_schema.type == 'OneToMany'
|
|
256
|
-
ids = records.
|
|
256
|
+
ids = records.filter_map { |record| record[field_schema.origin_key_target] }.uniq
|
|
257
257
|
sub_filter = Filter.new(condition_tree: ConditionTreeLeaf.new(field_schema.origin_key, 'In', ids))
|
|
258
258
|
sub_records = association.list(caller, sub_filter, projection.union([field_schema.origin_key]))
|
|
259
259
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_admin_datasource_customizer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.pre.beta.
|
|
4
|
+
version: 1.0.0.pre.beta.76
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthieu
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2024-10-
|
|
12
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|