Skip to content

Commit

Permalink
Fix regression in ::Transaction->count
Browse files Browse the repository at this point in the history
  • Loading branch information
abraxxa authored and Arthur Axel 'fREW' Schmidt committed Nov 26, 2015
1 parent 0864e7c commit 718810c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Revision history for {{$dist->name}}

{{$NEXT}}
- Fix regression in ::Transaction->count (Thanks Alexander Hartmaier!)

1.004000 2015-11-10 09:26:48-08:00 America/Los_Angeles
- Replace Moose with Moo
Expand Down
2 changes: 1 addition & 1 deletion lib/DBIx/Class/QueryLog/Transaction.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ has queries => (
);

sub add_to_queries { push @{shift->queries}, @_ }
sub count { scalar @{shift->log} }
sub count { scalar @{shift->queries} }

has rolledback => (
is => 'rw',
Expand Down
2 changes: 2 additions & 0 deletions t/03-buckets.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ $ql->bucket('foo');
$ql->txn_begin;
$ql->query_start('SELECT * from foo');
$ql->query_end('SELECT * from foo');
is($ql->current_transaction->count, 1, 'count of ::Transaction works');

$ql->txn_commit;
cmp_ok($ql->log->[1]->bucket, 'eq', 'foo', 'foo bucket');

Expand Down

0 comments on commit 718810c

Please sign in to comment.