[Catalyst] C::P::A::Store::DBIC and Schema support

Alex Kavanagh alex at tinwood.homelinux.org
Sun Feb 19 18:22:39 CET 2006


At Sun, 19 Feb 2006 16:39:17 +0000,
Matt S Trout wrote:
> 
> On Sun, Feb 19, 2006 at 04:16:42PM +0000, Alex Kavanagh wrote:

> > __PACKAGE__->config->{authentication}->{dbic} = {
> > 	       dbic_schema        => 'SiteDBIxSchema::Schema',
> > 	       user_class         => 'Users',
> >                user_field         => 'username',
> >                password_field     => 'password',
> >                password_type      => 'clear',  # will be 'hashed'
> >                password_hash_type => 'SHA-1',
> >            };
> > 
> > Unfortunately, that doesn't work because 'resultset' want's an object
> > and not a class name.  So I was wondering how anybody else has
> > configured this module with the schema code in trunk?
> 
> Not true; you can use a DBIx::Class::Schema subclass *or* an object of such
> a class.

Ah, okay.

I just tried this with dbic_schema as 'AJKSite::Model::SiteDB::Users'
which is a subclass of a DBIx::Class::Schema and it says that
resultset isn't found.  I must be doing something wrong here?  If I
just use AJKSite::Model::SiteDB then it gives me this error:

error was "Can't use string ("AJKSite::Model::SiteDB") as a HASH ref
while "strict refs" in use at /usr/share/perl5/Class/Accessor/Fast.pm
line 38

I guess this is quite reasonable!  I've now tried all (I think)
combinations of my Catalyst::Model::DBIC::Schema and
DBIx::Class::Schema derived classes and sub-class strings in
'dbic_model' and can't get resultset to give me anything back - i.e. I
can't get the trunk version to work.

For completeness:

AJKSite::Model::SiteDB isa Catalyst::Model::DBIC::Schema
DBIxSchema::Schema     isa DBIx::Class::Schema

-- 
Alex.



More information about the Catalyst mailing list