Skip to content

Commit

Permalink
Merge b77fe24 into 5548259
Browse files Browse the repository at this point in the history
  • Loading branch information
moltar committed Sep 12, 2014
2 parents 5548259 + b77fe24 commit e8f168d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/DBIx/Class/Helper/Row/ProxyResultSetMethod.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sub proxy_resultset_method {
}

sub copy {
delete local @{$_[0]->{_column_data}}{@{$_[0]->_proxy_slots}};
delete local @{$_[0]->{_column_data}}{@{$_[0]->_proxy_slots||[]}};

shift->next::method(@_);
}
Expand Down
3 changes: 2 additions & 1 deletion t/lib/TestSchema/Result/Bloaty.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package TestSchema::Result::Bloaty;

use DBIx::Class::Candy -components => [
'Helper::Row::ProxyResultSetUpdate'
'Helper::Row::ProxyResultSetUpdate',
'Helper::Row::ProxyResultSetMethod',
];

table 'Bloaty';
Expand Down
6 changes: 6 additions & 0 deletions t/row/proxy-resultset-method.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,11 @@ subtest 'copy result' => sub {
is $g3->id, 100, 'id is correctly overridden';
};

subtest 'copy result without any proxy defined' => sub {
my $bloaty = $schema->resultset('Bloaty')->first;
ok my $bcopy = $bloaty->copy({ id => 100, name => 'boo' }), 'Copied result';
is $bcopy->id, 100, 'id is correctly overridden';
};

done_testing;

0 comments on commit e8f168d

Please sign in to comment.