[Dbix-class] more schema questions

Alan Humphrey alan.humphrey at comcast.net
Sat Jan 7 00:03:00 CET 2006


> 
> Database:
> package BirdWeb::Admin::Model::DBIC;
> 
> use strict;
> use BirdWeb::Admin::Model::BirdWebSchema;
> 
> my @conn_info = (
>     'dbi:mysql:BirdWeb',
>     'user',
>     'pass',
>     { RaiseError => 1, PrintError => 0, ShowErrorStatement => 1,
TraceLevel
> => 0 }
> );
> 

Remove these two lines -

> __PACKAGE__->compose_connection( __PACKAGE__, @conn_info );
> __PACKAGE__->load_classes;

Replace with

BirdWeb::Admin::Model::BirdWebSchema->compose_connection( __PACKAGE__,
@conn_info );

Alan> done.

> 
> 1;
> 
> Test script:
> use Data::Dumper;
> 
> my $obj = BirdWeb::Admin::Model::DBIC::Birds->find(234);

better

my $obj = BirdWeb::Admin::Model::DBIC->class('Birds')->find(234);
 
Alan> changed.  No joy:

Can't locate object method "class" via package "BirdWeb::Admin::Model::DBIC"

I've confirmed I'm running version 0.04001 of DBIx::Class.




More information about the Dbix-class mailing list