<p>After discussing this on IRC with <a href="https://github.com/ribasushi" class="user-mention">@ribasushi</a>, I realised that to work generally in DBIC, it the data structure would have to be able to specify whether to cascade the copy recursively for all relationships, which gets more complicated. It'd have to be something like this, where the value gets passed on to the related -&gt;copy call if it's a hashref:</p>

<div class="highlight highlight-perl"><pre><span class="p">{</span>
    <span class="n">cascade</span> <span class="o">=&gt;</span> <span class="p">{</span>
        <span class="n">rel_one</span> <span class="o">=&gt;</span> <span class="p">{</span>            <span class="c1"># implicitly true</span>
            <span class="n">nested_rel</span> <span class="o">=&gt;</span> <span class="mi">0</span><span class="p">,</span>
        <span class="p">},</span>
        <span class="n">rel_two</span> <span class="o">=&gt;</span> <span class="mi">0</span><span class="p">,</span>            <span class="c1"># can't nest off false</span>
        <span class="n">rel_three</span> <span class="o">=&gt;</span> <span class="mi">1</span><span class="p">,</span>          <span class="c1"># further rels get default</span>
    <span class="p">},</span>
<span class="p">}</span>
</pre></div>

<p>If you don't have the time or inclination to do all this work (which is perfectly okay), I suggest implementing just what you need as a component that overrides <code>-&gt;copy</code> and <code>local</code>ises the <code>cascade_copy</code> attributes as needed.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/dbsrgits/dbix-class/pull/58#issuecomment-54145005">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/302594__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNTI4MDc3NCwiZGF0YSI6eyJpZCI6NDA3NjA5NTh9fQ==--f013258a6c39d9a75aaa7f307f626d7a03444f4d.gif" width="1" /></p>