bobtfish/catalyst-model-adaptor — pull request #2 by JForst (2012-07-25 13:33:05+00:00)
Title: NotMyApp::SomeClass may use MooseX::StrictConstructor

Hi,

Catalyst::Model::Adaptor causes an error on an external ModelClass which uses
MooseX::Contstructor, because catalyst default model has some extra args it passes to the
constructor.

see: http://paste.scsys.co.uk/202967

I had a short discussion with mst at this topic on irc. He gave me the patch
to remove extra arguments with a switch called strip_arguments, where the relevant args should
be listet.
__PACKAGE__->config(class => 'Blah', strip_arguments => [ qw(catalyst_component_name class) ]);

But as the Docs say there are no additional arguments handed over to external model class
it should not break things if one silently removes these extra arguments.

Please be patient this is my first patch :)

git commit message:

Catalyst::Model::Adaptor did send some extra args to the constructor.
Documentation says this should not be the case. A Model using
MooseX::StrictConstructor will die due to this.

_handle_catalystmodel_args is added to lib/Catalyst/Model/Adaptor/Base.pm
to delete these extra args, injected by the Catalyst Model.

t/live-test.t is simply doubled and uses a Model with
MooseX::StrictConstructor. This is done with t/strict-live-test.t and
t/lib/StrictTestApp.pm.

t/strict-live-test.t will only run if MooseX::StrictConstructor is
installed.

Not nice is, that argumentes to be removed are hardcoded in
_handle_catalystmodel_args. But I don't know any other way to get those
dynamically.