forest_admin_datasource_customizer 1.0.0.pre.beta.106 → 1.0.0.pre.beta.107

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: e23ea14b3b8709e5867141e20f5641696304feeb61b1105a2bc3153037d969d1
4
- data.tar.gz: 70a2ce17119f7be6c84884e1e7fa5ab1dbfc421fda69fdc4caa92dd03f2c397b
3
+ metadata.gz: 0ab6d363afcd836888a91f00128aec36cccfcb46bec1dd3facb4edfefe42e046
4
+ data.tar.gz: 5ad944810bb33109aec1aa3e84eceb06509c01226f2e691c46a8a2f9b0dd2e2a
5
5
  SHA512:
6
- metadata.gz: 3a15343effade63c142040094c016b1d7d60293fbdef97772202786f2342aae1b87244edbf05e7e001ad53def6ad5bf3e849dc8858f7a165b55173950fd8d211
7
- data.tar.gz: 3ee7b15148d33b9ea505ffc119fe7bd5a10d4f6650516f0960336ef867be8865fc66c662229f6b99bf888ef0f8df32c29993459436e962988177159f49b164e7
6
+ metadata.gz: 8709a173eb74328bb991c2abd91ad242312f3219cd28ab2da3fdecb1eda35c23c95652e5aef437e98ef6bbf80e32999461c72abd144ca0ec48a9a18458a1029f
7
+ data.tar.gz: 198eeba080dbbe0207006b90b1aa50b304f4c56200b98c1b46563e155fab13d6fa1f9671de383b53b3a9b85ba1797c5e1e30a620a1a90c0aae46288e76ebe222
@@ -183,7 +183,7 @@ module ForestAdminDatasourceCustomizer
183
183
  result = []
184
184
 
185
185
  if !@relations.key?(prefix)
186
- result = relation.rewrite_field(field[prefix.length + 1..]).map { |sub_field| "#{prefix}:#{sub_field}" }
186
+ result = relation.rewrite_field(field[(prefix.length + 1)..]).map { |sub_field| "#{prefix}:#{sub_field}" }
187
187
  elsif field_schema.is_a? Relations::ManyToOneSchema
188
188
  result = [field_schema.foreign_key]
189
189
  elsif field_schema.is_a?(Relations::OneToOneSchema) ||
@@ -152,13 +152,13 @@ module ForestAdminDatasourceCustomizer
152
152
  # Convert field path from child collection to this collection
153
153
  def path_from_child_collection(path)
154
154
  if path.include?(':')
155
- child_field = path[0..path.index(':') - 1]
155
+ child_field = path[0..(path.index(':') - 1)]
156
156
  relation_name = from_child_collection[child_field] || child_field
157
157
  relation_schema = schema[:fields][relation_name]
158
158
  if relation_schema.type != 'PolymorphicManyToOne'
159
159
  relation = datasource.get_collection(relation_schema.foreign_collection)
160
160
 
161
- return "#{relation_name}:#{relation.path_from_child_collection(path[path.index(":") + 1..])}"
161
+ return "#{relation_name}:#{relation.path_from_child_collection(path[(path.index(":") + 1)..])}"
162
162
  end
163
163
  end
164
164
 
@@ -168,17 +168,17 @@ module ForestAdminDatasourceCustomizer
168
168
  # Convert field path from this collection to child collection
169
169
  def path_to_child_collection(path)
170
170
  if path.include?(':')
171
- relation_name = path[0..path.index(':') - 1]
171
+ relation_name = path[0..(path.index(':') - 1)]
172
172
  relation_schema = schema[:fields][relation_name]
173
173
  if relation_schema.type == 'PolymorphicManyToOne'
174
174
  relation_name = to_child_collection[relation_name] || relation_name
175
175
 
176
- return "#{relation_name}:#{path[path.index(":") + 1..]}"
176
+ return "#{relation_name}:#{path[(path.index(":") + 1)..]}"
177
177
  else
178
178
  relation = datasource.get_collection(relation_schema.foreign_collection)
179
179
  child_field = to_child_collection[relation_name] || relation_name
180
180
 
181
- return "#{child_field}:#{relation.path_to_child_collection(path[path.index(":") + 1..])}"
181
+ return "#{child_field}:#{relation.path_to_child_collection(path[(path.index(":") + 1)..])}"
182
182
  end
183
183
  end
184
184
 
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceCustomizer
2
- VERSION = "1.0.0-beta.106"
2
+ VERSION = "1.0.0-beta.107"
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.106
4
+ version: 1.0.0.pre.beta.107
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: 2025-06-12 00:00:00.000000000 Z
12
+ date: 2025-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport