Subject: | Example a bit misleading |
Obviously this is most appropriate for utter Catalyst newbies like
myself. The example code in the docs uses "use base", but the current
version Catalyst helper creates a controller with use Moose and extends
'Catalyst::Model';
I made the mistake of copying and pasting the example into the generated
controller, which left me with something like:
package Myapp::Model::Solr;
use Moose;
use namespace::autoclean;
extends 'Catalyst::Model';
use base qw( Catalyst::Model::WebService::Solr );
__PACKAGE__->config(
server => 'http://localhost:8080/solr/',
options => {
autocommit => 1,
}
);
But as manni pointed out on IRC, extends and use base shouldn't be
mixed. Therefore I think an up-to-date example should look more like:
package MyApp::Model::Solr;
use Moose;
use namespace::autoclean;
extends 'Catalyst::Model::WebService::Solr';
__PACKAGE__->config(
server => 'http://localhost:8080/solr/',
options => {
autocommit => 1,
}
);