[Catalyst] trouble with model->dbic resultset
    Michael Higgins 
    linux at evolone.org
       
    Wed Dec  5 21:17:46 GMT 2007
    
    
  
Folks --
I'm writing a app that uses a DBIx::Class schema in @INC.
I use the same syntax in an app already running (albeit on a different
machine).
my $bill2 = $c->user->bill2->name; 
        $c->log->debug("shipper is $shipper billto is $bill2");
My $bill2 is defined, as it is printed in the debug. The resultset is
magically available as part of the user login configuration. Somehow,
it works.
However:
my $shippers = [$c->model('TrexDB::DATA')->search({ 'Bill To' =>
$bill2},{})->single];
my $count = scalar @$shippers; # s/b 1 (for testing)
The error is: Can't call method "search" on an undefined value
In my other app, which works, it looks the same. In this app file tree,
the two models sit next to one another in the /Model folder.
Since I have NO IDEA how my Model relates to my Schema, or really, how
it is I can access the schema in my cat app, can someone give me
anything else to check? 
Cheers,
-- 
 |\  /|        |   |          ~ ~  
 | \/ |        |---|          `|` ?
 |    |ichael  |   |iggins    \^ /
 michael.higgins[at]evolone[dot]org
    
    
More information about the Catalyst
mailing list