groditi: Guillermo Roditi <groditi@cpan.org>
+ilmari: Dagfinn Ilmari MannsE<aring>ker <ilmari@ilmari.org>
+
jesper: Jesper Krogh
jgoulah: John Goulah <jgoulah@cpan.org>
if ($source->result_class) {
my %map = %{$self->class_mappings};
- if (exists $map{$source->result_class}) {
+ if (exists $map{$source->result_class}
+ && $map{$source->result_class} ne $moniker) {
warn $source->result_class . ' already has a source, use register_extra_source for additional sources';
}
$map{$source->result_class} = $moniker;
use base qw/DBIx::Class::ResultSource::Table/;
}
-plan tests => 3;
+plan tests => 4;
my $schema = DBICTest->init_schema();
my $artist_source = $schema->source('Artist');
}
{
+ my $source = $schema->source('DBICTest::Artist');
+ $schema->register_source($source->source_name, $source);
+ is($warn, '', "regregistering an existing source under the same name causes no errors");
+}
+
+{
my $new_source_name = 'Artist->preview(artist_preview)';
$schema->register_source( $new_source_name => $new_source );