[Catalyst] DBIC Inheritance not preserved in Catalyst model

Scott Thomson smoothhound at gmail.com
Fri Sep 21 14:24:33 GMT 2007

I have a setup similar to this...

Class B inherits from class A and class C has a relationship to A.
A and B share the same table and use the dynamic sub-classing approach in
the DBIC cookbook to get the sub-classing to work.

When testing directly with the schema the classes behave as I would expect,
ie. I can set the relationship on C using an object of class either A or B.
However, when I use the schema inside my Catalyst app I get an error like
this when trying to set the property using the relationship on A to an
object of the sub-class C...

DBIx::Class::MyApp::new(): Object MyApp::Model::DBIC::A::B=3DHASH(0x392b6a0)
isn't a MyAPP::Model::DBIC::A (The error is generated in

It seems that the B isa A relationship is not preserved within the
MyApp::Model namespace.

The model works correctly in all other ways (so far).

Any ideas on how to get round this are extremely welcome  :)  I can post
real code if required.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070921/8eba5=

More information about the Catalyst mailing list