From: Rafael Kitover Date: Fri, 1 Jan 2010 12:42:03 +0000 (+0000) Subject: fix uninitialized warning and a bug in ResultSet X-Git-Tag: v0.08116~75^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f95e7c0757bc68b71c84a52c2430502772b873f;p=dbsrgits%2FDBIx-Class.git fix uninitialized warning and a bug in ResultSet --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 0605371..d3d71d1 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2523,7 +2523,8 @@ sub related_resultset { my $join_count = $attrs->{seen_join}{$rel}; - my $alias = $self->storage->relname_to_table_alias($rel, $join_count); + my $alias = $self->result_source->storage + ->relname_to_table_alias($rel, $join_count); #XXX - temp fix for result_class bug. There likely is a more elegant fix -groditi delete @{$attrs}{qw(result_class alias)}; diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 7be2455..2939f4a 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -2532,7 +2532,8 @@ C<"$relname">. sub relname_to_table_alias { my ($self, $relname, $join_count) = @_; - my $alias = ($join_count > 1 ? join('_', $relname, $join_count) : $relname); + my $alias = ($join_count && $join_count > 1 ? + join('_', $relname, $join_count) : $relname); return $alias; }