[Catalyst] How and where to run a method at Catalyst start up?

Tomas Doran bobtfish at bobtfish.net
Wed May 20 11:49:28 GMT 2009


Emmanuel Quevillon wrote:
> Thanks to try helping me. Here is the Trace from Devel::SimpleTrace. 
> Actually, the error is not even when I try
> to call my method from my Catalyst::Model but when I start the dev server :

Aha, yes - the stack trace makes it fairly clear what's happening!

Catalyst is trying to create your Model::Mapping _before_ it creates 
your other model..

And creating an instance of Model::Mapping relies on the other model 
having been setup first.

> I'll do it and post it to the list (github).

Ok, and having looked at the code - that isn't the issue that you're 
having in that test app..

The result classes for your DBIC models were in the wrong place, so DBIC 
wasn't finding them, ergo the call to ->model returning undef..

I have also fiddled with the code to make it not order sensitive, and (I 
think) more elegant.

http://github.com/bobtfish/startup/tree/ea22d1ac4af4a9e9f46dbbfd0c9f9963ede3fa5f

Cheers
t0m



More information about the Catalyst mailing list