[Catalyst] strange namespace behavior for dbic : schema
situationist at gmail.com
Thu Jun 7 17:35:00 GMT 2007
Using the helpers, I created a Model Bar
tmp_server lists all of its classes and instances like such...
| TMP::Model::Bar | instance |
| TMP::Model::Bar::Bar | class |
| TMP::Model::Bar::HeHe | class |
| TMP::Model::Bar::HaHa | class |
This continues for every table in the schema. Each has a prefix of Bar.
if I create another model using the helper, called Foo, with the same
schema object, it repeats. Every table in the schema, prefixed with
I can only load the resultsets by calling $c->model("Bar::Bar")
I can only load the result set by calling $c->model("Foo::Foo")
This looks ugly and will get even uglier I am sure as the app grows.
Haven't been able to avoid this behavior. Is there a good reason for
this or am I making a mistake?
Thank you in advance. Below is some sample code
use base qw/DBIx::Class::Schema DBIx::Class::AccessorGroup/;
__PACKAGE__->mk_group_accessors(simple => 'context');
__PACKAGE__->load_classes( qw// );
use base 'Catalyst::Model::DBIC::Schema';
schema_class => 'TMP::Schema'
More information about the Catalyst