Use of the "sub { ... }" in connect_info worked in versions < 0.24, but
not now.
(In other words, I want to connect to the database using the pkg
"myConnect".)
$ cat myapp/lib/myapp/Model.pm
package myapp::Model::DB;
use strict;
use base 'Catalyst::Model::DBIC::Schema';
use myConnect;
__PACKAGE__->config(
schema_class => 'DB::Schema',
connect_info => [
sub { myConnect->connect('dbi:SQLite:dbname=myapp.db') }
],
);
Here's the error msg using version > 0.24:
Couldn't instantiate component "myapp::Model::DB",
"MooseX::Types::TypeDecorator::AUTOLOAD(): invalid connect_info
at
/usr/lib/perl5/site_perl/5.8/Catalyst/Model/DBIC/Schema/Types.pm line 94."
at ./script/myapp_server.pl line 66
Compilation failed in require at ./script/myapp_server.pl line 66.