beachio-hammer 0.1.0.pre8 → 0.1.0.pre9

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: 589ceae0ff8729f2cb3ecc0ee32d4838ace1138571c9c86d71ca78c17056e528
4
- data.tar.gz: dca32a180fecf6664e35f2b6731190fc05c52fcf4833df8f0046dcb9030eb5f6
3
+ metadata.gz: '07779bca29478e635f67821d004ba96905631011cb967e95e00a6d1e84487411'
4
+ data.tar.gz: bc4e18fc7474ced30a3a7870526f52aa0d686929a3e6acdc65cfd3c220210498
5
5
  SHA512:
6
- metadata.gz: b150e39c1399ca2ae16ca81b6bc605cf5c98ce7a4574d802a575319de6b2bbd422f70a1c4c9b710da351d0d48003960ba31658cb0968f18388f665ff40630e3a
7
- data.tar.gz: 846a0033ac0b6a5f3da13e50c543eada11d89902c809f8db1970e90c7a03ff90e308e8ba3f752fc2f3ea1b63673ad67e30f4be5203d9d431d20ae091151d9961
6
+ metadata.gz: 4e448896ed2855bc9ff9cdc3577c42e7a0f701ef4deae3e3caddeb692a9239b0cedfa1caa6f92c1be0556bc98912a0d1a7aa8f63ef4f5d9a7ad09d8ff6da9af6
7
+ data.tar.gz: 8dd7f8b90f6111c8dcf800ee8270948f32594566993355e07d243f48654253d6ee4c63ab0ba30dc35d00d02536cb5de64565c5f3009ecae7ef4aad6c0e61685a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beachio-hammer (0.1.0.pre6)
4
+ beachio-hammer (0.1.0.pre9)
5
5
  json (~> 2.7)
6
6
 
7
7
  GEM
@@ -235,10 +235,14 @@ module Hammer
235
235
  processed = array_data.map do |item|
236
236
  item_content = template.dup
237
237
  item_hash = item.is_a?(Hash) ? item.transform_keys(&:to_s) : { "value" => item.to_s }
238
+ # Resolve dotted paths (e.g. @post.category.name) before scalar @post.category
239
+ # substitution — relation fields are Hashes and value_to_string(Hash) is empty.
240
+ item_content = process_nested_properties(item_content, item_hash, item_name)
238
241
  item_hash.each do |key, value|
242
+ next if value.is_a?(Hash) || value.is_a?(Array)
243
+
239
244
  item_content.gsub!("@#{item_name}.#{key}", value_to_string(value))
240
245
  end
241
- item_content = process_nested_properties(item_content, item_hash, item_name)
242
246
  item_content = process_conditionals_in_loop(item_content, item_hash, item_name)
243
247
  process_helper_expressions_in_loop(item_content, item_hash, item_name)
244
248
  end.join
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hammer
4
- VERSION = "0.1.0.pre8"
4
+ VERSION = "0.1.0.pre9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beachio-hammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre8
4
+ version: 0.1.0.pre9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beach.io