DBIx-Class-AuditLog
view release on metacpan or search on metacpan
t/011_update_on_deleted_row.t view on Meta::CPAN
[qw/ 1 test/],
]);
$schema->populate('Book',[
[qw/id isbn/],
[qw/ 1 12345678/],
]);
my $title = $schema->resultset('Title')->first;
$schema->txn_do(sub {
$title->book->delete;
$title->update({name => 'test2'}); # update cascades to deleted book
});
is $al_schema->resultset('AuditLogChangeset')->count, 1, 'One changeset logged';
my $cset = $al_schema->resultset('AuditLogChangeset')->first ;
is $cset->Action_rs->count, 2, 'Two actions logged';
my $action = $cset->Action_rs->first;
is $action->Change_rs->count, 2, 'Two changes logged';
( run in 1.014 second using v1.01-cache-2.11-cpan-49f99fa48dc )