[DBIx-Class-Devel] [dbix-class] Ability to override cascade_copy when calling Row->copy (#58)

Dagfinn Ilmari Mannsåker notifications at github.com
Tue Sep 2 12:39:34 GMT 2014


After discussing this on IRC with @ribasushi, 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 ->copy call if it's a hashref:
```perl
{
    cascade => {
        rel_one => {            # implicitly true
            nested_rel => 0,
        },
        rel_two => 0,            # can't nest off false
        rel_three => 1,          # further rels get default
    },
}
```
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 `->copy` and `local`ises the `cascade_copy` attributes as needed.

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/58#issuecomment-54145005
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20140902/5ed04855/attachment.htm>


More information about the DBIx-Class-Devel mailing list