hashugar icon indicating copy to clipboard operation
hashugar copied to clipboard

.to_hash does not always return the original hash

Open ragesoss opened this issue 7 years ago • 0 comments

Hashes that include arrays of hashes, at least, do not round-trip to Hashugar and back cleanly.

Hashugar.new({foo: {bar: [{baz: 1},{baz: 2},{baz: 3}]}}).to_hash

=> {:foo=>
  {:bar=>
    [#<Hashugar:0x0000559deb420700
      @table={"baz"=>1},
      @table_with_original_keys={:baz=>1}>,
     #<Hashugar:0x0000559deb420660
      @table={"baz"=>2},
      @table_with_original_keys={:baz=>2}>,
     #<Hashugar:0x0000559deb4205c0
      @table={"baz"=>3},
      @table_with_original_keys={:baz=>3}>]}}

ragesoss avatar Feb 23 '18 00:02 ragesoss