You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@data['nodes'].each do |key, value|
if key == 'a'
@h[0] = { 'a' => value }
else
parent_key = value['parent_id']
key_scope = Xf.scope(parent_key)
@h.map(&key_scope.set! do |h, k, v|
if v.present?
v['children'].update({ key => value })
end
end)
end
end
Input @DaTa['nodes'] can have over 1000 elements and output can get nested to level n
Any help will be greatly appreciated.
The text was updated successfully, but these errors were encountered:
I am struggling with this for couple of days, not able to form the desired deep nested hash, hope to get some help.
Input hash:
Desired result:
What I am trying is this
Input @DaTa['nodes'] can have over 1000 elements and output can get nested to level n
Any help will be greatly appreciated.
The text was updated successfully, but these errors were encountered: