add_components() doesn't prepend base when comp. prefixed with +
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Componentised.pm
index a642f85..737e24b 100644 (file)
@@ -15,14 +15,14 @@ sub inject_base {
 
   my $table = { Class::C3::_dump_MRO_table };
   eval "package $target; import Class::C3;" unless exists $table->{$target};
-  Class::C3::reinitialize() if defined $table->{$target};
 }
 
 sub load_components {
   my $class = shift;
   my $base = $class->component_base_class;
-  my @comp = map { "${base}::$_" } grep { $_ !~ /^#/ } @_;
+  my @comp = map { /^\+(.*)$/ ? $1 : "${base}::$_" } grep { $_ !~ /^#/ } @_;
   $class->_load_components(@comp);
+  Class::C3::reinitialize();
 }
 
 sub load_own_components {