From: Peter Rabbitson Date: Sat, 13 Jun 2009 16:10:22 +0000 (+0000) Subject: Do not use raw sources in {from} - proxy via source handles X-Git-Tag: v0.08107~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35ec03666abd9d13ef8d40444e25295f3a4441cc;p=dbsrgits%2FDBIx-Class.git Do not use raw sources in {from} - proxy via source handles --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index c220dd9..13d81b4 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2440,7 +2440,7 @@ sub _resolve_from { $attrs->{from} || [{ - -result_source => $source, + -source_handle => $source->handle, -alias => $attrs->{alias}, $attrs->{alias} => $source->from, }] @@ -2550,7 +2550,7 @@ sub _resolved_attrs { } $attrs->{from} ||= [ { - -result_source => $source, + -source_handle => $source->handle, -alias => $self->{attrs}{alias}, $self->{attrs}{alias} => $source->from, } ]; diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index aa636a7..2287bef 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -1135,7 +1135,7 @@ sub _resolve_join { my $rel_src = $self->related_source($join); return [ { $as => $rel_src->from, - -result_source => $rel_src, + -source_handle => $rel_src->handle, -join_type => $type, -join_path => [@$jpath, $join], -alias => $as, diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 0b4c4b7..e8cc52c 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1284,8 +1284,8 @@ sub _resolve_ident_sources { $tabinfo = $_->[0]; } - $alias2source->{$tabinfo->{-alias}} = $tabinfo->{-result_source} - if ($tabinfo->{-result_source}); + $alias2source->{$tabinfo->{-alias}} = $tabinfo->{-source_handle}->resolve + if ($tabinfo->{-source_handle}); } }