From: Arthur Axel "fREW" Schmidt Date: Thu, 4 Feb 2010 19:32:54 +0000 (+0000) Subject: fix incorrect test in t/76select.t and posit an incorrect solution X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bbd828a6a6ae6408fe8cca57d8052447345aa6a9;p=dbsrgits%2FDBIx-Class-Historic.git fix incorrect test in t/76select.t and posit an incorrect solution --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index cb7391b..2b0446f 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -299,12 +299,8 @@ sub search_rs { $new_attrs->{$key} = $self->_merge_attr($our_attrs->{$key}, $attrs->{$key}); } - if (List::Util::first { exists $new_attrs->{$_} } qw{select as}) { - delete $new_attrs->{$_} for (qw{+select +as}); - } - - if (exists $new_attrs->{columns}) { - delete $new_attrs->{'+columns'}; + if (List::Util::first { exists $new_attrs->{$_} } qw{select as columns}) { + delete $new_attrs->{$_} for (qw{+select +as +columns}); } my $cond = (@_ diff --git a/t/76select.t b/t/76select.t index d7c2b4a..01d62f5 100644 --- a/t/76select.t +++ b/t/76select.t @@ -89,13 +89,13 @@ lives_ok(sub { }, 'columns 2nd rscolumn present'); lives_ok(sub { - $rs->first->artist->get_column('name') -}, 'columns 3rd rscolumn present'); + $rs->first->artist->get_column('name') +}, 'columns 3rd rscolumn present'); $rs = $schema->resultset('CD')->search({}, - { + { 'join' => 'artist', '+columns' => ['cdid', 'title', 'artist.name'], } @@ -109,7 +109,7 @@ is_same_sql_bind ( ); lives_ok(sub { - $rs->first->get_column('cdid') + $rs->first->get_column('cdid') }, 'columns 1st rscolumn present'); lives_ok(sub { @@ -160,7 +160,6 @@ is_deeply ( track_position => 2, tracks => { - trackid => 17, title => 'Apiary', }, },