From: Alexander Hartmaier Date: Thu, 20 Aug 2009 15:46:06 +0000 (+0000) Subject: new branch grouped_has_many_join X-Git-Tag: v0.08111~59^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8423891f882417dd1f97ca5ef1effd929d624147;p=dbsrgits%2FDBIx-Class.git new branch grouped_has_many_join --- diff --git a/lib/DBIx/Class/Manual/Troubleshooting.pod b/lib/DBIx/Class/Manual/Troubleshooting.pod index 2a19c50..e3b1ab3 100644 --- a/lib/DBIx/Class/Manual/Troubleshooting.pod +++ b/lib/DBIx/Class/Manual/Troubleshooting.pod @@ -17,11 +17,11 @@ SQL tracing, so to see what is happening try Alternatively use the C<< storage->debug >> class method:- - $class->storage->debug(1); + $schema->storage->debug(1); To send the output somewhere else set debugfh:- - $class->storage->debugfh(IO::File->new('/tmp/trace.out', 'w'); + $schema->storage->debugfh(IO::File->new('/tmp/trace.out', 'w'); Alternatively you can do this with the environment variable too:- diff --git a/t/prefetch/grouped.t b/t/prefetch/grouped.t index 8e07612..8c29115 100644 --- a/t/prefetch/grouped.t +++ b/t/prefetch/grouped.t @@ -271,4 +271,16 @@ for ($cd_rs->all) { ); } +{ + $schema->storage->debug(1); + my $cd_rs = $schema->resultset('CD')->search(undef, { + distinct => 1, + join => [qw/ tracks /], + prefetch => [qw/ artist /], + }); + + is($cd_rs->all, 5, 'search with has_many join and distinct ok'); + $schema->storage->debug(0); +} + done_testing;