Skip to content

Commit

Permalink
Fix ::RemoveColumns to not wreak havoc when select/as is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Axel 'fREW' Schmidt committed Nov 11, 2017
1 parent eb3c371 commit 31cff72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Revision history for {{$dist->name}}

{{$NEXT}}
- Fix ::RemoveColumns and ::AutoRemoveColumns to not wreak havoc when select/as
is used (Thanks Vladimir Melnik for test and ribasushi for hint at fix!)
- Allow easily subclassing types to be skipped in ::ToJSON
(Thanks Paul Williams!) (closes GH#79 and GH#80)

Expand Down
2 changes: 1 addition & 1 deletion lib/DBIx/Class/Helper/ResultSet/RemoveColumns.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sub _resolved_attrs {

my $attrs = $self->{attrs}; # not copying on purpose...

if ( !$attrs->{columns} && $attrs->{remove_columns} ) {
if ( !$attrs->{columns} && !$attrs->{select} && $attrs->{remove_columns} ) {
my %rc = map { $_ => 1 } @{$attrs->{remove_columns}};
$attrs->{columns} = [
grep { !$rc{$_} } $self->result_source->columns
Expand Down

0 comments on commit 31cff72

Please sign in to comment.