forest_admin_datasource_customizer 1.46.4 → 1.48.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: 51f6ec1ef8f86789edc06c5278f04387f68e7c987faf902171089ed13e69896d
4
- data.tar.gz: c2909102b773f0668685ca71b0ab725f4e7b02a4d2f898fc7345c09af6d62dba
3
+ metadata.gz: a189da3686ece55a31efdb00dbf9b49215b6525b932f2413a98a6f86dab9a529
4
+ data.tar.gz: 206ce48d59c648db0ff37a715daeca665436923516b9b8fe7a90f5f1f656b998
5
5
  SHA512:
6
- metadata.gz: c6101d77649cf53973576c4a15ed5702cb28faace31e28a851d1bacc76ff5c1b58ac5fd5f499d478fbbc5397afd82861f27931617a41caa1f7479a08fdc1f512
7
- data.tar.gz: 58ad8a282569c918ec066a2b1a4c0bb299476b014a48506f36dee40a960fa751329147a40d5265f057ec2fecc7b6eff5e286907b582626c87a9a32ca53c2832c
6
+ metadata.gz: 31ff20336fb93db72991481f15cc7ec0d660a1f795ce17c4868313796a585c8d2eda413ae93bb944fbcbd03b37138792fe90c8e0510a448f43ad5fa7a936bbda
7
+ data.tar.gz: 6848c495b2029e0fa4a611b7f0013ed25d8efb2c9426142ad0a05fc6617edff16cec8daed462b53e0823e53ab5e4bb06c00fb002b904f9d6dde93d043a2b9563
@@ -305,6 +305,13 @@ module ForestAdminDatasourceCustomizer
305
305
  end
306
306
  end
307
307
 
308
+ # Like add_hook, but also fires for writes initiated from inside a smart action. Used by the audit trail.
309
+ def add_internal_hook(position, type, prepend: false, &handler)
310
+ push_customization do
311
+ @stack.internal_hook.get_collection(@name).add_hook(position, type, handler, prepend: prepend)
312
+ end
313
+ end
314
+
308
315
  # Add a new segment on the collection.
309
316
  # @param name the name of the segment
310
317
  # @param definition a function used to generate a condition tree or a condition tree
@@ -5,7 +5,7 @@ module ForestAdminDatasourceCustomizer
5
5
 
6
6
  attr_reader :datasource, :schema, :search, :early_computed, :late_computed, :action, :relation, :late_op_emulate,
7
7
  :early_op_emulate, :validation, :sort, :rename_field, :publication, :write, :chart, :hook, :segment,
8
- :binary, :override, :lazy_join
8
+ :binary, :override, :lazy_join, :internal_hook
9
9
 
10
10
  def initialize(datasource)
11
11
  @customizations = []
@@ -75,6 +75,9 @@ module ForestAdminDatasourceCustomizer
75
75
  last = @sort = DatasourceDecorator.new(last, Sort::SortCollectionDecorator)
76
76
 
77
77
  last = @chart = Chart::ChartDatasourceDecorator.new(last)
78
+ # Below `action` so writes emitted from inside a smart action also traverse it, and its after hooks
79
+ # complete before `hook`'s start: a customization raising in a public after hook can't preempt it.
80
+ last = @internal_hook = DatasourceDecorator.new(last, Hook::HookCollectionDecorator)
78
81
  last = @action = DatasourceDecorator.new(last, Action::ActionCollectionDecorator)
79
82
  last = @schema = DatasourceDecorator.new(last, Schema::SchemaCollectionDecorator)
80
83
  last = @write = Write::WriteDatasourceDecorator.new(last)
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceCustomizer
2
- VERSION = "1.46.4"
2
+ VERSION = "1.48.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_datasource_customizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.46.4
4
+ version: 1.48.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-23 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: activesupport
@@ -274,7 +273,6 @@ metadata:
274
273
  source_code_uri: https://github.com/ForestAdmin/agent-ruby
275
274
  changelog_uri: https://github.com/ForestAdmin/agent-ruby/blob/main/CHANGELOG.md
276
275
  rubygems_mfa_required: 'false'
277
- post_install_message:
278
276
  rdoc_options: []
279
277
  require_paths:
280
278
  - lib
@@ -289,8 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
287
  - !ruby/object:Gem::Version
290
288
  version: '0'
291
289
  requirements: []
292
- rubygems_version: 3.4.20
293
- signing_key:
290
+ rubygems_version: 3.6.7
294
291
  specification_version: 4
295
292
  summary: Ruby agent for Forest Admin.
296
293
  test_files: []