[Dbix-class] 'cascade_copy' - documentation patch

Anthony Gladdish a.j.gladdish at newcastle.ac.uk
Fri Mar 30 14:26:07 GMT 2007


Hi,

I'm using 'cascade_copy => 0' in a couple of my 'has_many'
relationships, and only stumbled across it by looking through the perl
actual code for the 'DBIx::Class::Relationship::HasMany' module, as it
appears to be absent from the DBIx::Class::Relationship documentation.
Here is a patch to add some notes about its use to the documentation:

--- ./temp/DBIx-Class-0.07005/lib/DBIx/Class/Relationship.pm
2007-01-11 08:41:10.00
0000000 +0000
+++ ./temp/Relationship.pm      2007-03-30 15:10:02.000000000 +0100
@@ -206,6 +206,11 @@
 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.

Thanks,

Anthony Gladdish
 



More information about the Dbix-class mailing list