From: John Napiorkowski Date: Thu, 8 May 2008 14:00:50 +0000 (+0000) Subject: Merge 'trunk' into 'replication_dedux' X-Git-Tag: v0.08240~402^2~52 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5ce78bdc81e8e98dc92f9fa978f4e3c035c1d616;hp=106d5f3b7e03a68fb2e125772e3f06a34115f22d;p=dbsrgits%2FDBIx-Class.git Merge 'trunk' into 'replication_dedux' r8568@dev (orig r4360): nigel | 2008-05-08 08:21:33 -0500 cascade_copy docs - takes from http://osdir.com/ml/lang.perl.modules.dbix-class/2007-03/msg00106.html r8569@dev (orig r4361): nigel | 2008-05-08 08:22:44 -0500 cascade_copy docs (format fixed) --- diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index 9edd7af..4dee96b 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -271,6 +271,11 @@ pass C<< cascade_delete => 0 >> in the C<$attr> hashref. However, any database-level cascade or restrict will take precedence over a DBIx-Class-based cascading delete. +If you copy an object in a class with a C relationship, all +the related objects will be copied as well. To turn this behaviour off, +pass C<< cascade_copy => 0 >> in the C<$attr> hashref. The behaviour +defaults to C<< cascade_copy => 1 >>. + See L for documentation on relationship methods and valid relationship attributes. diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 0ba7243..d2def31 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -547,7 +547,9 @@ sub set_inflated_columns { my $copy = $orig->copy({ change => $to, ... }); -Inserts a new row with the specified changes. +Inserts a new row with the specified changes. If the row has related +objects in a C then those objects may be copied too depending +on the C relationship attribute. =cut