[Dbix-class] Cascade deletes

Bill Moseley moseley at hank.org
Wed Mar 10 14:37:48 GMT 2010


On Tue, Mar 9, 2010 at 11:23 PM, Pedro Melo <melo at simplicidade.org> wrote:

> It was client work, I don't have access to the code anymore. But it
> looks good. See below for two improvements.
>    # Make sure we have options
>    # If we want to force cascade_* stuff
>    my $options =3D $rest[3] ||=3D {};
>

Thanks -- all of my classes already had the hash so assumed it was always
passed.



>     for ( qw/ cascade_delete cascade_copy / ) {
>         # Any user-defined value wins
>        $options->{$_} =3D 0 unless exists $options->{$_};
>     }
>

I figured I only needed to set it to zero if $options->{$_} was true, but I
guess it's supposed to be zero, not just false.

Thanks for the tips,





-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100310/9c7=
78aef/attachment.htm


More information about the DBIx-Class mailing list