Hello,
I'm trying to merge two attributes which are both arrays and got into the issue that on join I get a string and can't use it for iteration.
Also, I have noted that a simple attribute assignment changes the data type from array to string:
node.default['hosts'] = ["a", "b"]
node.default['hosts_new'] = "#{node.default['hosts']}"
puts "Initial data type: #{node['hosts'].class}"
puts "New data type: #{node['hosts_new'].class}"
Initial data type: Array
New data type: String
And my question if there a way to persist data type on attributes assignment?
Or maybe we should use a different approach for such cases.
Thank you!