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: 590118a8466a652324125c8a7ee7999e1e279a8e22914ea284db36dbe7dab090
4
- data.tar.gz: 44162473614d517a4e4aa12a3c56de9c696a882d414f2973b65f10a0d90578fa
3
+ metadata.gz: 0b5fe7b3fa12595e773355eaedcb7788ba02f0b568ea32df01f1e6c0ae3f4ab3
4
+ data.tar.gz: a7b8312f5dc5f83181bdcb86803aa276a95a0ba9d965b8399edb79124ef2c1e4
5
5
  SHA512:
6
- metadata.gz: 914c1dead4777e07d586fcd530cdb97ee37bd28b36abf921f3995364b58fa6708901d204e9da6782166533da44c141a9d69dcc9946800d4a402ba28a19a055e2
7
- data.tar.gz: 57acc31ff23a2b486ee18e02096742de27ea5891bcb4805d265e5229cba1b267b363276f3f0cd102caf702b87524970f929c0f3f8425923f1dc73d33d05d98c2
6
+ metadata.gz: c01d992fdd8f6e7380f032cdfa39868cf7f752c251e8451591944114227fa67c337b8666be551a2bc7d2e44dbe0a8f49b583a432080ecf8fd5033385df73a82e
7
+ data.tar.gz: 1b22c11c4d13a51cff787496130c0d9e9357e704ef760563d9819b48fc8392903d89c7c0fa8a3f9a56790227caead618b4928e577c8189be154f214bbe19a317
@@ -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.77"
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.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-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