On 7/21/06, Christopher H. Laco <[EMAIL PROTECTED]> wrote:
> Drew Taylor wrote:
> >
> > 2) I'm using DBIC w/ Catalyst, and thus am using C::P::DBIC::Schema
> > (latest version - no Loader). I'd like to have a base class common for
> > all my table objects (ie. a common toJSON() method), but can't figure
> > out how to do it in conjunction w/ the C::P::DBIC::Schema plugin.
>
> I'd suspect that it barfed because when the schema tried loading the
> result source classes, it tried loading My::Schema::BaseClass as it's
> own source, which it isn't.

I don't have the exact error message handy, so I can't say for sure,
but that sounds plausible.

> I assume you have a main schema file, something like My::Schema, that
> loads the My::Schema::User via load_classes()? By default, it will load
> all of the classes, including BaseClass.

Correct: I have:
__PACKAGE__->load_classes();
__PACKAGE__->connection(....);

> Try loading all the classes BUT My::Schema::BaseClass in your Schema and
> see if that fixes the issue under Model::DBIC::Schema/Catalyst.

So you're saying that once I get over the start-up problem, the normal
inheritance (via "use base Foo") will work like it always does? Is
there a load_classes() option to exclude certain classes?

Thanks,
Drew
-- 
----------------------------------------------------------------
 Drew Taylor                 *  Web development & consulting
 Email: [EMAIL PROTECTED]  *  Site implementation & hosting
 Web  : www.drewtaylor.com   *  perl/mod_perl/DBI/mysql/postgres
 ----------------------------------------------------------------

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to