From: Peter Rabbitson Date: Tue, 21 Apr 2009 18:06:25 +0000 (+0200) Subject: Merge 'subclassed_rsset' into 'trunk' X-Git-Tag: v0.08101~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=03e3321aba8d719195bf8a875e121e2b30e6655b;p=dbsrgits%2FDBIx-Class.git Merge 'subclassed_rsset' into 'trunk' --- 03e3321aba8d719195bf8a875e121e2b30e6655b diff --cc lib/DBIx/Class/Schema.pm index 1c4dd0e,2f85adb..5cb37fb --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@@ -1267,8 -1267,15 +1267,14 @@@ sub register_extra_source sub _register_source { my ($self, $moniker, $source, $params) = @_; + my $orig_source = $source; + $source = $source->new({ %$source, source_name => $moniker }); + $source->schema($self); + weaken($source->{schema}) if ref($self); + + my $rs_class = $source->result_class; - my %reg = %{$self->source_registrations}; $reg{$moniker} = $source; $self->source_registrations(\%reg); diff --cc t/39load_namespaces_rt41083.t index 861658e,c99528b..615036c --- a/t/39load_namespaces_rt41083.t +++ b/t/39load_namespaces_rt41083.t @@@ -2,31 -2,10 +2,12 @@@ use strict; use warnings; - use Test::More skip_all => 'Postponed until after 0.08100'; use lib 't/lib'; + use Test::More tests => 8; - =begin - - How did this get back here? The test is borked, there is a branch with - the correct test and a tentative fix - branches/subclassed_rsset - - Make sure to nuke this file when merging, it is only left here to make - merging of the above branch easier. - - - ribasushi - - - =cut - - - __END__ - - - - plan tests => 15; ++plan tests => 8; + sub _chk_warning { defined $_[0]? $_[0] !~ qr/We found ResultSet class '([^']+)' for '([^']+)', but it seems that you had already set '([^']+)' to use '([^']+)' instead/ :