forest_admin_datasource_customizer 1.39.2 → 1.39.4

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: e2511c286b5ae8f5ca42d5c9cd39c58ce1dcf78bb868c9f6d0f2cb70e33fa113
4
- data.tar.gz: ea2cb173c49bd8fb8d66a0d161ac6045e88d05b35bdf4bc302b4c985750bd863
3
+ metadata.gz: 0e27ddd127815efc565819841dd7eb44e4c9702313361df683af3bda69ec8078
4
+ data.tar.gz: 78078603e6c3bbd954f9e0556b0fa01590e7473ed4c40aea34219fabba6ee541
5
5
  SHA512:
6
- metadata.gz: 289a606405533d1d7f8fb13a9ae1ef3b36887a31dab1d4e89dc2f3ffe537b2805ccac8f33e556823120dce377f5730fbd4bba520447f5d5cffc067815ea1f48a
7
- data.tar.gz: 12c62a7e32817d67a896fe0b1d7be20dbf9245aac0432f24d5064d90580bd1a37a2b1b9794b793cebcb016d4b9079e5d199e9db427dc150cff8d8e617775cb02
6
+ metadata.gz: 856acd8c0c91d6aaf768fe3ba937a6ae8f461ad8af9a2397ce1fde80e13edc00af89226bd22267a66f030af9a9cad880765a18629587b3247f47084b59b1daa9
7
+ data.tar.gz: 99592e54c19593f625036a1e2678a3c88337daf2a2aad140b66960e58db0fe064a8959031fd2d1ea71dcbc87af562bd6c429b43fff3f49c048c78cbc02495617
@@ -51,15 +51,19 @@ module ForestAdminDatasourceCustomizer
51
51
  projection.apply(records)
52
52
  end
53
53
 
54
+ # `@sorts` holds nil as the value of an emulated field, so membership is
55
+ # read with `key?`, the way `emulated?` reads it. The ColumnSchema objects
56
+ # belong to the collection below, so each is copied before the flag is
57
+ # written.
54
58
  def refine_schema(child_schema)
55
- child_schema[:fields].each do |name, schema|
56
- if schema.type == 'Column'
57
- schema.is_sortable = true if @sorts[name].nil?
58
- child_schema[:fields][name] = schema
59
- end
59
+ schema = child_schema.dup
60
+ schema[:fields] = child_schema[:fields].to_h do |name, field|
61
+ next [name, field] unless field.type == 'Column' && @sorts.key?(name)
62
+
63
+ [name, field.dup.tap { |column| column.is_sortable = true }]
60
64
  end
61
65
 
62
- child_schema
66
+ schema
63
67
  end
64
68
 
65
69
  def rewrite_plain_sort_clause(clause)
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceCustomizer
2
- VERSION = "1.39.2"
2
+ VERSION = "1.39.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_datasource_customizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.39.2
4
+ version: 1.39.4
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-25 00:00:00.000000000 Z
12
+ date: 2026-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport