X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FIOC%2FSubContainer.pm;fp=lib%2FCatalyst%2FIOC%2FSubContainer.pm;h=afa8e3f82ed056918130f9689786a480e2ad3ac6;hb=5be6c1d8aa115905e3217fa220c903e950021abc;hp=8ebbceb10377e5d015f99c92fc2a4fcedcafbed7;hpb=b79f858d1c7bc042ba8dc8b33e66a71902266754;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/IOC/SubContainer.pm b/lib/Catalyst/IOC/SubContainer.pm index 8ebbceb..afa8e3f 100644 --- a/lib/Catalyst/IOC/SubContainer.pm +++ b/lib/Catalyst/IOC/SubContainer.pm @@ -9,6 +9,7 @@ has default_component => ( isa => 'Str|Undef', is => 'ro', required => 0, + writer => '_set_default_component', ); sub get_component { @@ -36,7 +37,7 @@ sub make_single_default { my @complist = $self->get_service_list; - $self->default_component( shift @complist ) + $self->_set_default_component( shift @complist ) if !$self->default_component && scalar @complist == 1; }