On Thu, Sep 22, 2011 at 02:04:04PM -0700, Lyle Kopnicky wrote:
> I just found an easier solution. Instead of:
> 
> __PACKAGE__->table_class('My::Schema::ResultSource::MyTable');
> 
> I override the table_class accessor:
> 
> sub table_class { 'My::Schema::ResultSource::MyTable' }
> 
> That way when sub table is called, the table_class is already defined.

Except that now table_class() is no longer an accessor, it's a plain constant.
Think of the cursing your way when the next maintainer needs to subclass your
own subclass and spends hours trying to figure out why all the examples he
can find do not seem to work for him.

Cheers

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

Reply via email to