From: David Kamholz Date: Sun, 26 Mar 2006 00:16:07 +0000 (+0000) Subject: missed a couple things X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=884559b13fe244d3e446d127e9fd21ea8d7c6eb3;p=dbsrgits%2FDBIx-Class-Historic.git missed a couple things --- diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index 1812b4d..ff455c1 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -105,7 +105,7 @@ Then you can use these classes in your application's code: # Create a result set that will fetch the artist relationship # at the same time as it fetches CDs, using only one query. - my $millennium_cds_rs = $ds->resultset('CD')->search( + my $millennium_cds_rs = $schema->resultset('CD')->search( { year => 2000 }, { prefetch => 'artist' } ); @@ -113,12 +113,12 @@ Then you can use these classes in your application's code: my $cd = $millennium_cds_rs->next; # SELECT ... FROM cds JOIN artists ... my $cd_artist_name = $cd->artist->name; # Already has the data so no query - my $new_cd = $ds->resultset('CD')->new({ title => 'Spoon' }); + my $new_cd = $schema->resultset('CD')->new({ title => 'Spoon' }); $new_cd->artist($cd->artist); $new_cd->insert; # Auto-increment primary key filled in after INSERT $new_cd->title('Fork'); - $ds->txn_do(sub { $new_cd->update }); # Runs the update in a transaction + $schema->txn_do(sub { $new_cd->update }); # Runs the update in a transaction $millennium_cds_rs->update({ year => 2002 }); # Single-query bulk update