Revision history for DBIx::Class
+ - fixed page-within-page bug (reported by nilsonsfj)
+
0.07999_05 2007-06-07 23:00:00
- Made source_name rw in ResultSource
- Fixed up SQL::Translator test/runtime dependencies
if ($attrs->{page}) {
$attrs->{rows} ||= 10;
- $attrs->{offset} ||= 0;
- $attrs->{offset} += ($attrs->{rows} * ($attrs->{page} - 1));
+ $attrs->{offset} ||= ($attrs->{rows} * ($attrs->{page} - 1));
}
$attrs->{alias} ||= 'me';
my $schema = DBICTest->init_schema();
-plan tests => 12;
+plan tests => 13;
# first page
my $it = $schema->resultset("CD")->search(
is( $it->next->title, "Generic Manufactured Singles", "software iterator->next ok" );
+# test paging with chained searches
+$it = $schema->resultset("CD")->search(
+ {},
+ { rows => 2,
+ page => 2 }
+)->search( undef, { order_by => 'title' } );
+
+is( $it->count, 2, "chained searches paging ok" );