From: Oliver Gorwits Date: Wed, 28 Apr 2010 21:08:52 +0000 (+0000) Subject: found a bug with use of id not $pk - thanks tests!! X-Git-Tag: v0.900201~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1891bb5f2ed75845540346b369354b1ed7f8a841;p=dbsrgits%2FDBIx-Class-Journal.git found a bug with use of id not $pk - thanks tests!! --- diff --git a/lib/DBIx/Class/Schema/Journal.pm b/lib/DBIx/Class/Schema/Journal.pm index 5eabd46..f2618f9 100644 --- a/lib/DBIx/Class/Schema/Journal.pm +++ b/lib/DBIx/Class/Schema/Journal.pm @@ -181,7 +181,7 @@ sub prepopulate_journal { # create the audit log entries for the rows in this page $log_rs->populate([ - map {{ create_id => $log_ids[$_], id => $x[$_]->{$pk} }} (0 .. $#x) + map {{ create_id => $log_ids[$_], $pk => $x[$_]->{$pk} }} (0 .. $#x) ]); # now populate the audit history diff --git a/t/03populate.t b/t/03populate.t index c6fa507..d03a3a1 100644 --- a/t/03populate.t +++ b/t/03populate.t @@ -6,7 +6,7 @@ BEGIN { eval "use DBD::SQLite; use SQL::Translator"; plan $@ ? ( skip_all => 'needs DBD::SQLite and SQL::Translator for testing' ) - : ( tests => 21 ); + : ( tests => 17 ); } use lib qw(t/lib); @@ -14,9 +14,9 @@ use DBICTest; # connect to db and deploy only the original db schema, not journal schema my $schema = DBICTest->init_schema(no_populate => 1, no_deploy => 1); -$schema->deploy; ok($schema, 'Created a Schema'); +$schema->deploy; # check we have no journal my $count = eval {