[Catalyst] $c->model('table') vs MyApp::Model::table

apv apv at sedition.com
Sat Jan 14 08:43:11 CET 2006


Just in case there is anyone left who hasn't filtered me to the 
bit-bucket yet. (I'll have to start paying Matt consulting fees soon.)

With "use base qw( Catalyst::Model::CDBI::Sweet );" in the DB base 
class, and having a subclass "MyApp::Model::tablename" this --
     my @posts = MyApp::Model::tablename->retrieve_all();
works perfectly while this --
     my @posts = $c->model('tablename')->retrieve_all();
gets "Caught exception "Can't call method "retrieve_all" on an 
undefined value at..."

The first fully qualified package is fine but I like the "all from the 
catalyst object" idiom better. Any tips or ideas for debugging it?

-Ashley




More information about the Catalyst mailing list