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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a08b0080df1f1c62f858d2331564cf0c24c5bd580f83303a32689bd285d3c40c
4
- data.tar.gz: 4a5eeaf9ca98801f06068d57266aa3ce8bbeed13aece27e1c9b9ae2dbf40e62d
3
+ metadata.gz: 764a841e1351dfa82b375dd79e0934eb95d527fdf0b5ae75ea83229bdbb2bc3f
4
+ data.tar.gz: aeda42cfbbd425b72dca62c9c081a15c88b690daacfd5b0b9c7566a403c5c0cd
5
5
  SHA512:
6
- metadata.gz: 776f6136e689fe8e5705051f1ebcfea1d4e2e7813708532612fa1b25a0e6fc9308e3ac301f8fa0f3154a26da5cebf570151139b76bc2858f86fc7c877b06bc4e
7
- data.tar.gz: 8b506f90dd0d20c97b8b6cda872d018b5b1c106d2e041f5b958f6b6cea40d3dd223289b3b925c1b67915359e5320e3595954cff3026ef2cfc50c2a5a7e3888dc
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 @rpc_collections.include?(collection.name)
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| @rpc_collections.include?(fc) }
170
+ relation.foreign_collections.any? { |fc| rpc_collection?(fc) }
163
171
  else
164
- @rpc_collections.include?(relation.foreign_collection)
172
+ rpc_collection?(relation.foreign_collection)
165
173
  end
166
174
  end
167
175
  end
@@ -1,3 +1,3 @@
1
1
  module ForestAdminRpcAgent
2
- VERSION = "1.43.1"
2
+ VERSION = "1.44.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_rpc_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.43.1
4
+ version: 1.44.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu