[Dbix-class] Catalyst::Model::DBIC::Schema

Brandon Black blblack at gmail.com
Thu Feb 9 07:28:34 CET 2006


On 2/8/06, Daisuke Murase <typester at cpan.org> wrote:
> I tried it, but it didn't work.
>
> In my controller,
>
>    $c->model('Schema')->resultset('Table')->search->all;
>
> then rises following error:
>
>    Can't call method "select" on an undefined value at
>    /usr/local/share/perl/5.8.4/DBIx/Class/ResultSet.pm line 284.
>
>
> I think Model::Schema has wrong connection handling.
>
>    $self->schema->connect(@{$self->{connect_info}});
>
> IMO, it should be:
>
>    $self->schema( $self->schema->connect(@{$self->{connect_info}}) );
>
> or so?
>

Yes, this was a mistake, what the line should have read is:

$self->schema->connection(@{$self->{connect_info}});
(connection instead of connect)

-- Brandon



More information about the Dbix-class mailing list