[Catalyst] CDBI::Plain not loading model components

Geoff Richards qef at ungwe.org
Fri Feb 10 15:06:12 CET 2006


On Fri, Feb 10, 2006 at 01:12:05PM +0000, Geoff Richards wrote:
> On Fri, Feb 10, 2006 at 12:02:25PM +0000, David Hodgkinson wrote:
> > 
> > On 10 Feb 2006, at 11:46, Geoff Richards wrote:
> > >
> > > I've tried using Catalyst::Model::CDBI::Plain for my model classes,
> > > but it doesn't seem to set them up as Catalyst 'component' things,
> > > so I can't get at them through $c->model().
> > 
> > What version of Cat? I had this on 5.61 and was told to upgrade and it
> > worked again.
> 
> I've just upgraded from 5.63 to 5.64, and it still doesn't load any
> of them.

Fixed now.  Turns out the problem was that Catalyst::Model::CDBI::Plain
doesn't give you the constructor from Catalyst::Component.  Instead
you get the one from Catalyst::Base which always returns an object
of class Catalyst::Base.  I don't really know what's going on well
enough to see why, but it seems to help if I put Catalyst::Component
in as another base class for my table model classes.  Like this:

    package MyApp::M::DB::Thing;
    use warnings;
    use strict;

    use base qw<Catalyst::Component MyApp::M::DB>;

    __PACKAGE__->table('thing');
    ...

That's one problem down at least...

-- 

--- Geoff Richards -------------><-------------- http://ungwe.org/ ---
"I tried to fling my shadow at the moon,
 The while my blood leapt with a wordless song."  --  Theodore Roethke



More information about the Catalyst mailing list