On 7/21/06, Drew Taylor <[EMAIL PROTECTED]> 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.
>
> At first I just tried having My::Schema::User inherit directly from
> My::Schema::BaseClass, but that makes DBIC barf on Catalyst startup.
It shouldn't - I'm using just such a setup myself. All of my source
classes inherit from various other base classes. Just to be sure
we've got this straight:
Check that...
My::Schema ISA DBIx::Class::Schema
My::Schema::User ISA My::Schema::BaseClass
My::Schema::BaseClass ISA DBIx::Class
My::Schema->resultset('User') ISA DBIx::Class::ResultSet
My::Schema->resultset('User')->find('joebob') ISA My::Schema::User
My::Schema->resultset('User')->find('joebob')->toJSON works?
Then...
My::Model->config->{schema_class} IS My::Schema
$c-model('My::Model::User')->find('joebob')->toJSON works?
-- Brandon
_______________________________________________
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]/