X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FComponentised.pm;h=2ee90941a631dc2d6784dcbf4c036eb08dcfb94f;hb=5efe4c7916e1fb2132c1b73ab4ddddbced317adb;hp=8ea297c455ef6999ae9be6f58f4619f5c30acf3e;hpb=9a15732eb45a540351080f22f519fbd54a9de12c;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Componentised.pm b/lib/DBIx/Class/Componentised.pm index 8ea297c..2ee9094 100644 --- a/lib/DBIx/Class/Componentised.pm +++ b/lib/DBIx/Class/Componentised.pm @@ -6,16 +6,17 @@ sub inject_base { my ($class, $target, @to_inject) = @_; { no strict 'refs'; - unshift(@{"${target}::ISA"}, grep { $target ne $_ } @to_inject); + unshift(@{"${target}::ISA"}, grep { $target ne $_ && !$target->isa($_)} @to_inject); } my $table = { Class::C3::_dump_MRO_table }; - eval "package $target; use Class::C3;" unless exists $table->{$target}; + eval "package $target; import Class::C3;" unless exists $table->{$target}; Class::C3::reinitialize() if defined $table->{$target}; } sub load_components { my $class = shift; - my @comp = map { "DBIx::Class::$_" } grep { $_ !~ /^#/ } @_; + my $base = $class->component_base_class; + my @comp = map { "${base}::$_" } grep { $_ !~ /^#/ } @_; $class->_load_components(@comp); }