From: Matt S Trout Date: Tue, 20 Sep 2005 06:46:39 +0000 (+0000) Subject: Error message fix (cheers Siracusa), CDBICompat count_all fix (cheers Numa) X-Git-Tag: v0.03001~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3125eb1fc9e9dcff0572b1c01cd1a802a9c4862c;p=dbsrgits%2FDBIx-Class.git Error message fix (cheers Siracusa), CDBICompat count_all fix (cheers Numa) --- diff --git a/lib/DBIx/Class/CDBICompat/Retrieve.pm b/lib/DBIx/Class/CDBICompat/Retrieve.pm index 58a39d4..6937fb3 100644 --- a/lib/DBIx/Class/CDBICompat/Retrieve.pm +++ b/lib/DBIx/Class/CDBICompat/Retrieve.pm @@ -4,10 +4,10 @@ use strict; use warnings FATAL => 'all'; sub retrieve { shift->find(@_) } -sub retrieve_all { shift->search_literal('1', @_) } +sub retrieve_all { shift->search } sub retrieve_from_sql { shift->search_literal(@_) } -sub count_all { shift->count_literal('1') } +sub count_all { shift->count } # Contributed by Numa. No test for this though. 1; diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 3db3638..db8d56d 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -99,7 +99,7 @@ sub _construct_object { } elsif ($rel_obj->{attrs}{accessor} eq 'filter') { $new->{_inflated_column}{$pre} = $fetched; } else { - $self->{class}->throw("Don't know to to store prefetched $pre"); + $self->{class}->throw("Don't know how to store prefetched $pre"); } } } diff --git a/t/cdbi-t/02-Film.t b/t/cdbi-t/02-Film.t index ffccecd..b31ea5f 100644 --- a/t/cdbi-t/02-Film.t +++ b/t/cdbi-t/02-Film.t @@ -4,7 +4,7 @@ $| = 1; BEGIN { eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 95); + plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 96); } INIT { @@ -80,6 +80,9 @@ $gone->update; cmp_ok(@films, '==', 2, "We have 2 films in total"); } +# EXTRA TEST: added by mst to check a bug found by Numa +cmp_ok(Film->count_all, '==', 2, "count_all confirms 2 films"); + my $gone_copy = Film->retrieve('Gone With The Wind'); ok($gone->NumExplodingSheep == 5, 'update()'); ok($gone->Rating eq 'NC-17', 'update() again');