forest_admin_agent 1.39.0 → 1.39.1
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 +4 -4
- data/lib/forest_admin_agent/routes/abstract_related_route.rb +3 -1
- data/lib/forest_admin_agent/routes/resources/related/update_related.rb +1 -1
- data/lib/forest_admin_agent/routes/resources/update.rb +10 -0
- data/lib/forest_admin_agent/utils/schema/schema_emitter.rb +1 -1
- data/lib/forest_admin_agent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 428e77bbb38c12b3b742940d6389b10953d719dbbb01ee121130dd01f9eb8868
|
|
4
|
+
data.tar.gz: 1b87f61a2aceb41b7ecd1e1c65339374a3f50c9faccaaf48331cebbff73a8760
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d1408d54a4650b3850fd62647704eaca320f376603639328d3e2356b0064adc1a2cbd05920040eafd0314fce89cba22fb09456b8244a9d6e238c21bc7c54b50
|
|
7
|
+
data.tar.gz: a30686d3e81a9febf50189dc66249922c288ab33c9868f51c6d91ff40c2ace58c512bd185e2dd2230c35bbf78e2823485db9ea5685f745bf4183c17a44c9bf64
|
|
@@ -6,7 +6,9 @@ module ForestAdminAgent
|
|
|
6
6
|
|
|
7
7
|
relation = context.collection.schema[:fields][args[:params]['relation_name']]
|
|
8
8
|
context.child_collection = if relation.type == 'PolymorphicManyToOne'
|
|
9
|
-
|
|
9
|
+
if (type = args.dig(:params, 'data', 'type'))
|
|
10
|
+
context.datasource.get_collection(type)
|
|
11
|
+
end
|
|
10
12
|
else
|
|
11
13
|
context.datasource.get_collection(relation.foreign_collection)
|
|
12
14
|
end
|
|
@@ -89,7 +89,7 @@ module ForestAdminAgent
|
|
|
89
89
|
)
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
-
polymorphic_type = context.child_collection
|
|
92
|
+
polymorphic_type = context.child_collection&.name&.gsub('__', '::')
|
|
93
93
|
context.collection.update(
|
|
94
94
|
context.caller,
|
|
95
95
|
scoped_fk_owner_filter(parent_primary_key_values, context),
|
|
@@ -23,6 +23,7 @@ module ForestAdminAgent
|
|
|
23
23
|
filter = ForestAdminDatasourceToolkit::Components::Query::Filter.new(
|
|
24
24
|
condition_tree: ConditionTree::ConditionTreeFactory.intersect([condition_tree, scope])
|
|
25
25
|
)
|
|
26
|
+
drop_relationships!(args)
|
|
26
27
|
data = format_attributes(args, context.collection)
|
|
27
28
|
context.collection.update(context.caller, filter, data)
|
|
28
29
|
records = context.collection.list(context.caller, filter, ProjectionFactory.all(context.collection))
|
|
@@ -37,6 +38,15 @@ module ForestAdminAgent
|
|
|
37
38
|
)
|
|
38
39
|
}
|
|
39
40
|
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
# The frontend writes relations through PUT /:collection/:id/relationships/:name, which fires
|
|
45
|
+
# before this route. Honouring the relationships block here would turn the untouched relations
|
|
46
|
+
# it always resends as `data: null` into foreign keys set to nil. Parity with agent-nodejs.
|
|
47
|
+
def drop_relationships!(args)
|
|
48
|
+
args[:params][:data].delete(:relationships)
|
|
49
|
+
end
|
|
40
50
|
end
|
|
41
51
|
end
|
|
42
52
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_admin_agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.39.
|
|
4
|
+
version: 1.39.1
|
|
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: 2026-08-
|
|
12
|
+
date: 2026-08-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|