forest_admin_rpc_agent 1.43.1 → 1.44.0
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_rpc_agent/agent.rb +11 -3
- data/lib/forest_admin_rpc_agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 764a841e1351dfa82b375dd79e0934eb95d527fdf0b5ae75ea83229bdbb2bc3f
|
|
4
|
+
data.tar.gz: aeda42cfbbd425b72dca62c9c081a15c88b690daacfd5b0b9c7566a403c5c0cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cbe05caa88e9d28c6e5e423ed6a9c21b1cb11a4ac8d8d63f9a6a9e7d69d9b20f3a2d3669d57a68c07a7e05f9cef20a2a98fbba12b05d350003ec5e725a39ac54
|
|
7
|
+
data.tar.gz: 1aa823f3fb9f17e28654bd206c5727f7df2b8973a7b8a4b3e15b65cbec27ae87153556aa571d725073f751de39568b7b7efad78a8a7f6ae6a8123673e8699da9
|
|
@@ -46,11 +46,19 @@ module ForestAdminRpcAgent
|
|
|
46
46
|
)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
# Regexp patterns are matched with `match?`, i.e. unanchored: /rpc_/ also matches "admin_rpc_logs".
|
|
50
|
+
# Anchor patterns (e.g. /^rpc_/) to avoid unintentionally catching unrelated collections.
|
|
49
51
|
def mark_collections_as_rpc(*names)
|
|
50
52
|
@rpc_collections.push(*names)
|
|
51
53
|
self
|
|
52
54
|
end
|
|
53
55
|
|
|
56
|
+
def rpc_collection?(name)
|
|
57
|
+
@rpc_collections.any? do |pattern|
|
|
58
|
+
pattern.is_a?(Regexp) ? pattern.match?(name) : pattern == name
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
54
62
|
private
|
|
55
63
|
|
|
56
64
|
def should_skip_schema_update?
|
|
@@ -83,7 +91,7 @@ module ForestAdminRpcAgent
|
|
|
83
91
|
datasource.collections.each_value do |collection|
|
|
84
92
|
relations = {}
|
|
85
93
|
|
|
86
|
-
if
|
|
94
|
+
if rpc_collection?(collection.name)
|
|
87
95
|
extract_rpc_collection_relations(collection, relations)
|
|
88
96
|
else
|
|
89
97
|
collections << build_normal_collection_payload(collection, relations)
|
|
@@ -159,9 +167,9 @@ module ForestAdminRpcAgent
|
|
|
159
167
|
|
|
160
168
|
def relation_targets_rpc_collection?(relation)
|
|
161
169
|
if relation.type == 'PolymorphicManyToOne'
|
|
162
|
-
relation.foreign_collections.any? { |fc|
|
|
170
|
+
relation.foreign_collections.any? { |fc| rpc_collection?(fc) }
|
|
163
171
|
else
|
|
164
|
-
|
|
172
|
+
rpc_collection?(relation.foreign_collection)
|
|
165
173
|
end
|
|
166
174
|
end
|
|
167
175
|
end
|