From: Peter Rabbitson Date: Wed, 10 Jun 2009 11:33:14 +0000 (+0000) Subject: Duh, this was a pretty simple bug X-Git-Tag: v0.08106~15^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7025db7cf067da5d78d0735ef9ce1b8fbc73094d;hp=4086a32559a91ba6f70833fa770054e7bae4000e;p=dbsrgits%2FDBIx-Class.git Duh, this was a pretty simple bug --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 7b34a86..515e45f 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2430,12 +2430,15 @@ sub _resolve_from { my $source = $self->result_source; my $attrs = $self->{attrs}; - my $from = $attrs->{from} - || [ { - -result_source => $source, - -alias => $attrs->{alias}, - $attrs->{alias} => $source->from, - } ]; + my $from = [ @{ + $attrs->{from} + || + [{ + -result_source => $source, + -alias => $attrs->{alias}, + $attrs->{alias} => $source->from, + }] + }]; my $seen = { %{$attrs->{seen_join} || {} } }; diff --git a/t/search/preserve_original_rs.t b/t/search/preserve_original_rs.t index 3e59109..d628e9b 100644 --- a/t/search/preserve_original_rs.t +++ b/t/search/preserve_original_rs.t @@ -80,9 +80,9 @@ $q{artw_back}{query} = $q{artw_back}{rs}->as_query; for my $s (qw/a2a artw cd artw_back/) { my $rs = $q{$s}{rs}; - lives_ok ( sub { $rs->first }, "first on $s does not throw an exception" ); + lives_ok ( sub { $rs->first }, "first() on $s does not throw an exception" ); - lives_ok ( sub { $rs->count }, "count on $s does not throw an exception" ); + lives_ok ( sub { $rs->count }, "count() on $s does not throw an exception" ); is_same_sql_bind ($rs->as_query, $q{$s}{query}, "$s resultset unmodified (as_query matches)" ); }