From: Tomas Doran Date: Wed, 10 Aug 2011 21:44:34 +0000 (+0100) Subject: Get the 'real' components, not the compat ones for the list X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=3552850bf9f1c075b5c296cfc8d9c792956ca81e Get the 'real' components, not the compat ones for the list --- diff --git a/lib/Catalyst/IOC/Container.pm b/lib/Catalyst/IOC/Container.pm index 30a7a77..880fa96 100644 --- a/lib/Catalyst/IOC/Container.pm +++ b/lib/Catalyst/IOC/Container.pm @@ -611,14 +611,19 @@ sub get_all_components { my $self = shift; my %components; - my $container = $self->get_sub_container('component'); - - for my $component ($container->get_service_list) { - my $comp = $container->resolve( - service => $component - ); - my $comp_name = ref $comp || $comp; - $components{$comp_name} = $comp; + foreach my $type (qw/model view controller /) { + my $container = $self->get_sub_container('component'); + + for my $component ($container->get_service_list) { + my $comp = $container->resolve( + service => $component + ); + my $comp_name = ref $comp || $comp; # THIS IS WRONG! :) + # Just as it is called Model::Foo + # does not mean it has to be + # an instance of model::foo + $components{$comp_name} = $comp; + } } return lock_hash %components;