[Catalyst-dev] Problems with $c->model() and _comp_singular()

Matt S Trout dbix-class at trout.me.uk
Tue Aug 8 18:06:48 CEST 2006

Jonas wrote:
> Maybe $c->model should return the DBIC model schema if it founds one.
> That way if you have a DBIC Model schema named MyApp::Model::Foo and
> want to get the Bar resultset you just have to write
> $c->model->resultset('Bar') instead of
> $c->model('Foo')->resultset('Bar'). I know that you can write
> $c->model('Foo::Bar'); but the other form is useful if you don't know
> the model name. In the new instantCRUD it's possible to define the
> model name in the helper but than i don't know what name the user as
> chosen so i can't have it hardcoded in the base controllers. What i
> did to circumvent that was to write the model name in the generated
> app config.
> Just an idea...

Or you could set default_model and do it properly.

Doing that by default would be horrible, could cause unexpected behaviours - 
what if they've got two DBIC::Schema models?

More information about the Catalyst-dev mailing list