Hello all,

I am having trouble using DBIx::ResultClass::HashRefInflator on a result set 
that has table joins.

$c->stash(rs => $c->model(DB::TABLE1))
$rs = $c->stash->{rs};

$rs = $rs->search(
   undef,
    {   
        select => [COL1, TABLE2.COL2, TABLE2.COL3, TABLE2.COL4],
        join => [TABLE2],
        }   
    );  

The SQL output gives me the correct sql statement, but

$rs->result_class('DBIx::Class::ResultClass::HashRefInflator');
 @infl = $rs->all;


{
            'TABLE2' => {
                        'COL2' => '1',
                        'COL3' => '-1',
                      },
            'COL1' => 'val'
 }

but it should be
{
            'TABLE2' => {
                        'COL2' => 'val',
                        'COL3' => 'val',
                        'COL4' => 'val',
                      },
            'COL1' => 'val'
 },


However, using 

$cursor = $rs->cursor;
while (my @vals = $cursor->next) {
       $c->log->debug("ROW: @vals");
}

Gives me the correct number of columns.

DBIx::ResultClass::HashRefInflator works great for all my other non table 
joining endeavors. It would be nice to be able to use it for the joins as well 
to keep my code uniform.

Any ideas for me?

Best,
Jillian


 
_______________________________________________
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