forest_admin_datasource_customizer 1.0.0.pre.beta.75 → 1.0.0.pre.beta.76

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: 590118a8466a652324125c8a7ee7999e1e279a8e22914ea284db36dbe7dab090
4
- data.tar.gz: 44162473614d517a4e4aa12a3c56de9c696a882d414f2973b65f10a0d90578fa
3
+ metadata.gz: ec0291e3a471fa36686b1b840a374ac749683e326b348138407b06c809d92127
4
+ data.tar.gz: b8fe6d62d4a46f8ce072a9547e6d6f2bef0889a3fa9dcc2e041182f9f99ae542
5
5
  SHA512:
6
- metadata.gz: 914c1dead4777e07d586fcd530cdb97ee37bd28b36abf921f3995364b58fa6708901d204e9da6782166533da44c141a9d69dcc9946800d4a402ba28a19a055e2
7
- data.tar.gz: 57acc31ff23a2b486ee18e02096742de27ea5891bcb4805d265e5229cba1b267b363276f3f0cd102caf702b87524970f929c0f3f8425923f1dc73d33d05d98c2
6
+ metadata.gz: 123afdc034a99235250f9e8fa23df824f786ef8be242340f0a6463acfa6e99f133fff4c6d0970915f96827bbfedff3d3c2942f6be675bd67999de4ecffaf1d75
7
+ data.tar.gz: 1b553a2b4290d6b49c5b4f070b22b934f86f13f8f6dada6333a82609f4177d73282448402941f30ecf857994ae9143e27f143e2509190af73b93428f15cd2dd7
@@ -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.map { |r| r[name] }.filter { |fk| !fk.nil? }, projection)
246
+ association.re_project_in_place(caller, records.filter_map { |r| r[name] }, projection)
247
247
  elsif field_schema.type == 'ManyToOne'
248
- ids = records.map { |record| record[field_schema.foreign_key] }.filter { |fk| !fk.nil? }.uniq
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.map { |record| record[field_schema.origin_key_target] }.filter { |okt| !okt.nil? }.uniq
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
 
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceCustomizer
2
- VERSION = "1.0.0-beta.75"
2
+ VERSION = "1.0.0-beta.76"
3
3
  end
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.75
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-10 00:00:00.000000000 Z
12
+ date: 2024-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport