[Dbix-class] "regression" introduced in DBIC r5298.. Or we're Doing
It Wrong..
Toby Corkindale
toby.corkindale at strategicdata.com.au
Wed Jun 3 08:14:13 GMT 2009
Hi guys,
I've encountered a regression in DBIC, introduced in revision 5298.
It's more than likely that the way things were being done in the code
here were not correct and *shouldn't* have worked previously, but I
can't seem to work it out myself.
There's a single changed line which triggers the problem:
--------------------------------------------------------
diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm
@@ -1228,7 +1229,7 @@ sub register_extra_source {
sub _register_source {
my ($self, $moniker, $source, $params) = @_;
- %$source = %{ $source->new( { %$source, source_name => $moniker }) };
+ $source = $source->new({ %$source, source_name => $moniker });
--------------------------------------------------------
I've created a small unit test that demonstrates the issue, here:
http://dryft.net/dbic/tobyc-dbic-problem.tar.gz
The failure manifests itself as missing relationships on the result
sources. They're clearly setup, and it all works fine until the above
line is changed in DBIC/Schema.pm.
Any help would be most appreciated.
Cheers,
Toby
More information about the DBIx-Class
mailing list