forest_admin_agent 1.8.6 → 1.8.7

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: 7579f60b79df6f4e04130b745f7745ea992bb842c3f5dfe2d7ff7aeafe71247a
4
- data.tar.gz: dfe3081243f79d3c222dd77dd562536a96fa594d4807e25d901eec6f8ee886a2
3
+ metadata.gz: 2d25c2b519a49cdd5110d8611122af3ea0bcd57f80e009a2669d7102053a9cb5
4
+ data.tar.gz: 357f0e2cbd33aa68ed598b85b0b83c8f600d555bf87c9b74cacb6ecf9d45ee3f
5
5
  SHA512:
6
- metadata.gz: c8a86edcbe07271fb40f97fa18c218301b425707dec736628f4f283a2bd296ead800ca4c5436ababa7a7e35d8193bf701d64b01474326b177e058eae80ac5e78
7
- data.tar.gz: c97e50102c5688b89201ad2483ca8922e39a58b8b33b2b949f4d78bfc488831238c1dbf888eebb7a8080a61f4ff002eaf2e7506e8f780243bfeea0cd6c1e9491
6
+ metadata.gz: c295f5d048b9f506bd79a2ee38da994da4b5cef3d0b8f6640f78bee97fc06fe94774f8c7f05929d9d51e56be88c8ad40fc435c4bef1e38c7c469df5060df4d46
7
+ data.tar.gz: 67583f70e8a69e8584f7c15865affd83aea0550219bd57a6ad9215b41912610199e1cf32de254a391687ba6be22804590773c95b439f0f231e66748b7f8a8caa
@@ -63,6 +63,13 @@ module ForestAdminAgent
63
63
  attributes_map.each do |attribute_name, attr_data|
64
64
  next if !should_include_attr?(attribute_name, attr_data)
65
65
  value = evaluate_attr_or_block(attribute_name, attr_data[:attr_or_block])
66
+ # Only include the attribute if it's not nil or if the key exists in the object
67
+ # This prevents setting all fields to null for included records
68
+ if value.nil?
69
+ # Check if the key actually exists in the object (for Hash objects)
70
+ # If the key exists in the object, it means that the value is purposely set to null
71
+ next unless @object.is_a?(Hash) && @object.key?(attribute_name.to_s)
72
+ end
66
73
  attributes[format_name(attribute_name)] = value
67
74
  end
68
75
  attributes
@@ -138,9 +145,9 @@ module ForestAdminAgent
138
145
  end
139
146
 
140
147
  object = has_one_relationship(attribute_name, attr_data)
141
- if object.nil? || object.empty?
142
- data[formatted_attribute_name]['data'] = nil
143
- else
148
+ # Only include 'data' key if the relationship object exists
149
+ # Omit 'data' key entirely when null instead of setting it to null
150
+ unless object.nil? || (object.respond_to?(:empty?) && object.empty?)
144
151
  relation = datasource.get_collection(@options[:class_name].gsub('::', '__'))
145
152
  .schema[:fields][attribute_name.to_s]
146
153
  options = @options.clone
@@ -6,7 +6,7 @@ module ForestAdminAgent
6
6
  module Schema
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "agent-ruby"
9
- LIANA_VERSION = "1.8.6"
9
+ LIANA_VERSION = "1.8.7"
10
10
 
11
11
  def self.generate(datasource)
12
12
  datasource.collections
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.8.6"
2
+ VERSION = "1.8.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.8.7
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: 2025-10-17 00:00:00.000000000 Z
12
+ date: 2025-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport