forest_admin_datasource_customizer 1.0.0.pre.beta.97 → 1.0.0.pre.beta.98
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbcdbac95176a4c99cddfb4d4e1c32182d80c50e4d1b3e39b36c12bac3fe8ed
|
4
|
+
data.tar.gz: 8438091e0f5481b7c6ef0d7d9762e10c1c983ad4779cd8b1e3cc60731175b9d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed029d1f4515d79d7e450b09832cd60f1c34eeb48a7ce5fba5aca7b4c2f48249ee0b432ed383b0186cb767073a11c89761254c08cb20a06c1f42dbcf897aa247
|
7
|
+
data.tar.gz: e9acf968fae4ee907b26c0469f6864ab82f79e563f5f799efa088db1a64a6c2cda2779e25835ce9cf85c9e5af3140dd57fe9d421fa97d59a9587b3003ce7b053
|
@@ -152,14 +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
|
-
|
156
|
-
child_field = paths[0]
|
155
|
+
child_field = path[0..path.index(':') - 1]
|
157
156
|
relation_name = from_child_collection[child_field] || child_field
|
158
157
|
relation_schema = schema[:fields][relation_name]
|
159
158
|
if relation_schema.type != 'PolymorphicManyToOne'
|
160
159
|
relation = datasource.get_collection(relation_schema.foreign_collection)
|
161
160
|
|
162
|
-
return "#{relation_name}:#{relation.path_from_child_collection(
|
161
|
+
return "#{relation_name}:#{relation.path_from_child_collection(path[path.index(":") + 1..])}"
|
163
162
|
end
|
164
163
|
end
|
165
164
|
|
@@ -169,18 +168,17 @@ module ForestAdminDatasourceCustomizer
|
|
169
168
|
# Convert field path from this collection to child collection
|
170
169
|
def path_to_child_collection(path)
|
171
170
|
if path.include?(':')
|
172
|
-
|
173
|
-
relation_name = paths[0]
|
171
|
+
relation_name = path[0..path.index(':') - 1]
|
174
172
|
relation_schema = schema[:fields][relation_name]
|
175
173
|
if relation_schema.type == 'PolymorphicManyToOne'
|
176
174
|
relation_name = to_child_collection[relation_name] || relation_name
|
177
175
|
|
178
|
-
return "#{relation_name}:#{
|
176
|
+
return "#{relation_name}:#{path[path.index(":") + 1..]}"
|
179
177
|
else
|
180
178
|
relation = datasource.get_collection(relation_schema.foreign_collection)
|
181
179
|
child_field = to_child_collection[relation_name] || relation_name
|
182
180
|
|
183
|
-
return "#{child_field}:#{relation.path_to_child_collection(
|
181
|
+
return "#{child_field}:#{relation.path_to_child_collection(path[path.index(":") + 1..])}"
|
184
182
|
end
|
185
183
|
end
|
186
184
|
|
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.98
|
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-02-
|
12
|
+
date: 2025-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|