Revision history for DBIx::Class
+ - add_components() doesn't prepend base when comp. prefixed with +
- $schema->deploy
- HAVING support
- prefetch for has_many
sc_
+Robert Sedlacek <phaylon@dunkelheit.at>
+
=head1 LICENSE
You may distribute this code under the same terms as Perl itself.
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();
}
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More;
+
+use lib qw(t/lib);
+use DBICTest::ForeignComponent;
+
+plan tests => 1;
+
+# Tests if foreign component was loaded by calling foreign's method
+ok( DBICTest::ForeignComponent->foreign_test_method, 'foreign component' );
+
--- /dev/null
+# belongs to t/05components.t
+package DBICTest::ForeignComponent;
+use warnings;
+use strict;
+
+use base qw/ DBIx::Class /;
+
+__PACKAGE__->load_components( qw/ +DBICTest::ForeignComponent::TestComp / );
+
+1;
--- /dev/null
+# belongs to t/05components.t
+package DBICTest::ForeignComponent::TestComp;
+use warnings;
+use strict;
+
+sub foreign_test_method { 1 }
+
+1;