I have the following:
{ :a_b_c => 42, :a_b_d => 67, :a_d => 89, :e => 90 }
How do I convert this as below
{ a: { b: { c: 42, d: 67 }, d: 89 }, e: 90 }
I have the following:
{ :a_b_c => 42, :a_b_d => 67, :a_d => 89, :e => 90 }
How do I convert this as below
{ a: { b: { c: 42, d: 67 }, d: 89 }, e: 90 }
Copyright © 2021 Jogjafile Inc.
Rails with ActiveSupport have
Hash#deep_mergeandHash#deep_merge!If you haven't them, you can define
Or just require these methods
And finally