https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2014-07-10T13:38:53Z
Ruby Issue Tracking System
Ruby master - Bug #10023: Hash#merge fails duplicating objects
https://bugs.ruby-lang.org/issues/10023?journal_id=47682
2014-07-10T13:38:53Z
coyote (Alexey Babich)
alexey@alexey.od.ua
<ul></ul><p>Please, also note that Rails' <code>deep_merge</code> does not help</p>
Ruby master - Bug #10023: Hash#merge fails duplicating objects
https://bugs.ruby-lang.org/issues/10023?journal_id=47683
2014-07-10T13:42:13Z
coyote (Alexey Babich)
alexey@alexey.od.ua
<ul></ul><p>The same with duplication</p>
<blockquote>
<blockquote>
<p>c=A.dup #same .clone<br>
=> {:b=>{}}<br>
c.merge!({c: {d: 'e'}})<br>
=> {:b=>{}, :c=>{:d=>"e"}}<br>
c[:b][:d] = 'bug'<br>
=> "bug"<br>
A<br>
=> {:b=>{:d=>"bug"}}</p>
</blockquote>
</blockquote>
Ruby master - Bug #10023: Hash#merge fails duplicating objects
https://bugs.ruby-lang.org/issues/10023?journal_id=47684
2014-07-10T13:44:22Z
coyote (Alexey Babich)
alexey@alexey.od.ua
<ul></ul><p>Please, note that only Rails' <code>deep_dup</code> seems helpful to workaround the issue</p>
Ruby master - Bug #10023: Hash#merge fails duplicating objects
https://bugs.ruby-lang.org/issues/10023?journal_id=47685
2014-07-10T13:44:45Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>Not a bug.<br>
<code>A[:b]</code> and <code>c[:b]</code> refer the same object.<br>
Check its <code>object_id</code>.</p>