Merge 'trunk' into 'replication_dedux'
John Napiorkowski [Thu, 8 May 2008 14:00:50 +0000 (14:00 +0000)]
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)

lib/DBIx/Class/Relationship.pm
lib/DBIx/Class/Row.pm

index 9edd7af..4dee96b 100644 (file)
@@ -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<has_many> 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<DBIx::Class::Relationship::Base> for documentation on relationship
 methods and valid relationship attributes.
 
index 0ba7243..d2def31 100644 (file)
@@ -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<has_many> then those objects may be copied too depending
+on the C<cascade_copy> relationship attribute.
 
 =cut