forest_admin_datasource_customizer 1.0.0.pre.beta.75 → 1.0.0.pre.beta.77
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b5fe7b3fa12595e773355eaedcb7788ba02f0b568ea32df01f1e6c0ae3f4ab3
|
4
|
+
data.tar.gz: a7b8312f5dc5f83181bdcb86803aa276a95a0ba9d965b8399edb79124ef2c1e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c01d992fdd8f6e7380f032cdfa39868cf7f752c251e8451591944114227fa67c337b8666be551a2bc7d2e44dbe0a8f49b583a432080ecf8fd5033385df73a82e
|
7
|
+
data.tar.gz: 1b22c11c4d13a51cff787496130c0d9e9357e704ef760563d9819b48fc8392903d89c7c0fa8a3f9a56790227caead618b4928e577c8189be154f214bbe19a317
|
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.77
|
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
|