[Catalyst] subclassing model classes

Wallace Reis wallace at reis.org.br
Tue Dec 15 23:13:04 GMT 2009


On 15/12/2009, at 14:58, matthew couchman (JIC) wrote:
> I now have a couple of subclasses of Point called Vertex and Placemark. I'm trying to associate them with my new ResultSet subclasses.
> 
> In MyApp::Schema::Result::Vertex:
> 
> use base 'MyApp::Schema::Result::Point';
> __PACKAGE__->resultset_class('MyApp::Schema::ResultSet::Vertex');
> 
> 
> And in MyApp::Schema::Result::Placemark:
> 
> use base 'MyApp::Schema::Result::Point';
> __PACKAGE__->resultset_class('MyApp::Schema::ResultSet::Placemark');
> 
> 
> I think __PACKAGE__->resultset_class is calling the parent class MyApp::Schema::Result::Point->resultset_class in both cases so the second call overwrites the first. How do I avoid this?


How are you identifying this behaviour? It shouldn't be like that.
What does "print $schema->source($_)->resultset_class for qw(Vertex Placemark)" output?

--
   wallace reis/wreis         Catalyst and DBIx::Class consultancy with a clue
   Software Engineer          and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
http://www.shadowcat.co.uk     http://www.linkedin.com/in/wallacereis


More information about the Catalyst mailing list