On Fri, Feb 6, 2015 at 12:29 AM, Peter Rabbitson <rabbit+d...@rabbit.us>
wrote:

> On 02/05/2015 09:56 PM, Seth Daniel wrote:
>
>>
>> ...
>>
>>
>> my $rs = $s->resultset( 'A' )
>>             ->search( { 'B.name' => 'some_name' },
>>                       { columns => [ 'id', { 'A_B.B.name => 'B.name' } ],
>>                         collapse => 1,
>>                         join => [ { A_B => 'B' },
>>                                   { A_B => 'B' } ] } );
>>
>> This does return only the columns I ask for, but it also only returns
>> the B that match the search criteria instead of all B for the selected A.
>>
>
> Yes - you asked for B.name to be put into A_B.B.name and you also
> referenced it in the where condition. What you want is (likely)
> columns => [ 'id', { 'A_B.B.name => 'B_2.name' }
>
> Check the generated DBIC_TRACE=1 (and maybe in addition
> DBIC_TRACE_PROFILE=console) to easier wrap your head around what is going
> on.
>
> Cheers
>

 That was it.  Thank you very much.
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to