From: Norbert Buchmuller Date: Wed, 2 Sep 2009 02:42:25 +0000 (+0200) Subject: Added many-to-many add_to_*() example to stress that it returns the related row and... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=babc1644e07d11b4ac3e2bbff1c75b57deb4681b;p=dbsrgits%2FDBIx-Class-Historic.git Added many-to-many add_to_*() example to stress that it returns the related row and not the linking table row. --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 5a9e75d..e168c36 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -1113,6 +1113,16 @@ This is straightforward using Laddresses(); # get all addresses for a user $rs = $address->users(); # get all users for an address + my $address = $user->add_to_addresses( # returns a My::Address instance, + # NOT a My::UserAddress instance! + { + country => 'United Kingdom', + area_code => 'XYZ', + town => 'London', + street => 'Sesame', + } + ); + =head2 Relationships across DB schemas Mapping relationships across L