forest_admin_agent 1.46.3 → 1.47.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: e52d3d37dd23fa657a733dad796c988c7a6d070d39f2bcea2fe8da884e5ed791
4
- data.tar.gz: ab75a027751a703bda3a35a2b8c6cba046552da3b9511a379fce304274297a2c
3
+ metadata.gz: 24a29d40927535f076eb8353abd44e1825a64324e102944c250ac882c01a3dcb
4
+ data.tar.gz: 2b43060825da0b2fca90393f0b65fa93bc3933e7f410553b8b33d230c1a96ca1
5
5
  SHA512:
6
- metadata.gz: 01e14b5c1410e354d7e8101a1d4a584f7ce453d23c34260c946c5a74a6b5c298d4184c7c6cb6889c1e862a3247ac39229e905b12825bcbd17ed07d13febbac3f
7
- data.tar.gz: 73c1c0b3d9093a9b75c267b5786f74533907ab0c52602e1809d82bc3cfda2497f87fa524daf4cee76e0f1b73eeccd724318b516831ca5dc7c18750bebaae1ee1
6
+ metadata.gz: e77e3892dcf0a456a89a1d5199e1f582f33187f64d9c197df556a6fe3c4560adfc10a09e38670cb049e9630820efcf205e5d01165d4335ef0877165624efb848
7
+ data.tar.gz: a3ab87f07b033727407a2b4979c8f62c1d8e50c3761cc95224d09efd205119f4a0811a61b1b56dc6bccc9a28816c63104a5f8d4e6a5b8617bd16305a3a5f8a38
@@ -127,6 +127,14 @@ module ForestAdminAgent
127
127
  "The collection #{context.collection.name} does not have this smart action"
128
128
  end
129
129
 
130
+ # A single action runs on its first record, or on nothing: refuse any selection but one id.
131
+ def ensure_single_record(context, selection_ids)
132
+ return unless context.collection.schema[:actions][@action_name].scope == Types::ActionScope::SINGLE
133
+ return unless selection_ids[:are_excluded] || selection_ids[:ids].size != 1
134
+
135
+ raise Http::Exceptions::UnprocessableError, 'This action can only be triggered on one record at a time.'
136
+ end
137
+
130
138
  # Recorded as pending before the action runs and confirmed after, so an action that takes the process
131
139
  # down with it still leaves evidence that it started. A failed run is worth recording too — "who tried
132
140
  # to run this" is usually the interesting part — and an action answering with an Error result failed
@@ -229,6 +237,7 @@ module ForestAdminAgent
229
237
  # Restrict the filter to the selected records for single or bulk actions
230
238
  if context.collection.schema[:actions][@action_name].scope != Types::ActionScope::GLOBAL
231
239
  selection_ids = Utils::Id.parse_selection_ids(context.collection, args[:params])
240
+ ensure_single_record(context, selection_ids)
232
241
  selected_ids = ConditionTreeFactory.match_ids(context.collection, selection_ids[:ids])
233
242
  selected_ids = selected_ids.inverse if selection_ids[:are_excluded]
234
243
  filter = filter.override(
@@ -6,7 +6,7 @@ module ForestAdminAgent
6
6
  module Schema
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "agent-ruby"
9
- LIANA_VERSION = "1.46.3"
9
+ LIANA_VERSION = "1.47.0"
10
10
 
11
11
  def self.generate(datasource)
12
12
  datasource.collections
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.46.3"
2
+ VERSION = "1.47.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.46.3
4
+ version: 1.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
8
8
  - Nicolas
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2026-10-21 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activerecord
@@ -478,7 +477,6 @@ metadata:
478
477
  source_code_uri: https://github.com/ForestAdmin/agent-ruby
479
478
  changelog_uri: https://github.com/ForestAdmin/agent-ruby/blob/main/CHANGELOG.md
480
479
  rubygems_mfa_required: 'false'
481
- post_install_message:
482
480
  rdoc_options: []
483
481
  require_paths:
484
482
  - lib
@@ -493,8 +491,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
493
491
  - !ruby/object:Gem::Version
494
492
  version: '0'
495
493
  requirements: []
496
- rubygems_version: 3.4.20
497
- signing_key:
494
+ rubygems_version: 3.6.7
498
495
  specification_version: 4
499
496
  summary: Ruby agent for Forest Admin.
500
497
  test_files: []