forest_admin_datasource_customizer 1.0.0.pre.beta.74 → 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: bf679183775153a49d7b5e2fef5efde165f37c025c2953062f016b0ccec4718a
4
- data.tar.gz: a596c2c2747260b156869ed611e530dde45d35d01e76982ac8bdcc5df68a828a
3
+ metadata.gz: ec0291e3a471fa36686b1b840a374ac749683e326b348138407b06c809d92127
4
+ data.tar.gz: b8fe6d62d4a46f8ce072a9547e6d6f2bef0889a3fa9dcc2e041182f9f99ae542
5
5
  SHA512:
6
- metadata.gz: 86dd19341cf5abb6050103202b3a242f2c71a4baa2de5c28056479cd1dfed7887af124a0c07f504048210beff4c6f907ad0222d7a82ed664376b9af11b721e05
7
- data.tar.gz: 10e2709dc13fdef43ccbdd650b90c9257eae1923160744f77ccf6de8b58a829cd35387f2a833b91a39a62689f1966352fd600c05ce98e24266b862c201aa31d7
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.74"
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.74
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