Subject: | Can't load schema with pre-defined connect_info... |
Catalyst/Model/DBIC/Schema.pm's BUILD method includes this:
if( !$self->connect_info ) {
if($schema_class->storage && $schema_class->storage->connect_info) {
$self->connect_info($schema_class->storage->connect_info);
}
else {
die "Either ->config->{connect_info} must be defined for $class"
. " or $schema_class must have connect info defined on
it."
. " Here's what we got:\n"
. Dumper($self);
}
}
Unfortunately, it also includes this:
has connect_info => (is => 'ro', isa => ConnectInfo, coerce => 1);
So if you actually have this situation, where the connect_info is
defined in the schema_class, but not in the model, then you end up with
an unloadable model:
Couldn't instantiate component "MyApp::Web::Model::DB", "Cannot assign a
value to a read-only accessor at
/usr/local/lib/perl5/site_perl/5.10.0/Catalyst/Model/DBIC/Schema.pm line 467
--
www.jasonkohles.com