load_classes vs load_namespaces

Today I copied a Catalyst application to a machine that had an older version of Catalyst::Model::DBIC::Schema. I didn't realize until I regenerated the schema like this

./script/seminar_create.pl model DB DBIC::Schema Seminar::Schema create=static components=InflateColumn::FS  dbi:SQLite:seminar.db 

and I saw that the result set files where in the wrong directory ( they where in lib/Seminar/Schema/ instead of lib/Seminar/Schema/Result/). Also, in lib/Seminar/Schema.pm the line

__PACKAGE__->load_namespaces;

had been replaced by

__PACKAGE__->load_classes;

I read in the catalyst tutorial http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial::03_MoreCatalystBasics that this was due to an old version of Catalyst::Model::DBIC::Schema, but after upgrading said module to the most recent version the problem persisted.

It took me a while to figure out that I had to manually replace load_classes with load_namespaces. After I did that the Catalyst Helper started generating the result set files in the proper directory. I guess it is a feature, not a bug, that the helper checks whether the application uses load_namespaces or load_classes, and goes into "compatibility mode" if classes is used.

no comments | Read more...

Last modified: 2009-6-23 (火) at 12:29 pm