From: Peter Rabbitson Date: Wed, 2 Sep 2009 10:25:35 +0000 (+0000) Subject: Invoke default_join_type only on undefined types X-Git-Tag: v0.08111~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=243ddc4a9c9e446ab7a8a3b805bcc8ed0d17f3ef;p=dbsrgits%2FDBIx-Class.git Invoke default_join_type only on undefined types --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index dfa4c78..eee5e3d 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -1237,9 +1237,10 @@ sub _resolve_join { my $type; if ($force_left) { $type = 'left'; - } else { - $type = $rel_info->{attrs}{join_type} || ''; - $force_left = 1 if lc($type) eq 'left'; + } + else { + $type = $rel_info->{attrs}{join_type}; + $force_left = 1 if lc($type||'') eq 'left'; } my $rel_src = $self->related_source($join); diff --git a/lib/DBIx/Class/SQLAHacks.pm b/lib/DBIx/Class/SQLAHacks.pm index f44ed4f..3a0d1f6 100644 --- a/lib/DBIx/Class/SQLAHacks.pm +++ b/lib/DBIx/Class/SQLAHacks.pm @@ -517,7 +517,7 @@ sub _recurse_from { $join_type =~ s/^\s+ | \s+$//xg; } - $join_type ||= $self->_default_jointype; + $join_type = $self->_default_jointype if not defined $join_type; my $join_clause = sprintf ('%s JOIN ', $join_type ? ' ' . uc($join_type) : ''