[Dbix-class] Cascade deletes
Bill Moseley
moseley at hank.org
Wed Mar 10 20:15:44 GMT 2010
On Wed, Mar 10, 2010 at 11:38 AM, Peter Rabbitson
<rabbit+dbic at rabbit.us<rabbit%2Bdbic at rabbit.us>
> wrote:
>
>
> As you already realized down the thread, this is the wrong place to
> add a default. It's the individual cascade-setting helper that you need to
> override:
>
> sub has_many {
> my ($self, @args) =3D @_;
> $args[3] =3D { %your_defaults, %{$args[3]||{}} };
> $self->next::method(@args);
> }
>
Peter, aren't there other relationships that can have cascade_delete?
Indeed if I use the above then dump the options in add_relationship there's
plenty of other's with cascade_delete =3D> 1, (like "has_one" relationships=
).
add_relationship seems more global in scope.
-- =
Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100310/e7f=
fc93a/attachment.htm
More information about the DBIx-Class
mailing list