[Catalyst-commits] r12446 -
trunk/examples/CatalystAdvent/root/2009/pen
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Mon Dec 21 15:33:12 GMT 2009
Author: caelum
Date: 2009-12-21 15:33:11 +0000 (Mon, 21 Dec 2009)
New Revision: 12446
Modified:
trunk/examples/CatalystAdvent/root/2009/pen/22.pod
Log:
last minute bug fix
Modified: trunk/examples/CatalystAdvent/root/2009/pen/22.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2009/pen/22.pod 2009-12-21 15:03:43 UTC (rev 12445)
+++ trunk/examples/CatalystAdvent/root/2009/pen/22.pod 2009-12-21 15:33:11 UTC (rev 12446)
@@ -153,15 +153,18 @@
my %data;
my $rs = $c->model('DB::Book')->search({}, {
- page => $page,
- rows => $rows,
order_by => "$sort_by $sort_order",
});
$rs = $rs->search_literal("lower($search_by) LIKE ?", lc($search_text))
if $search_by && $search_text;
- $data{total} = $c->model('DB::Book')->count;
+ my $paged_rs = $rs->search({}, {
+ page => $page,
+ rows => $rows,
+ });
+
+ $data{total} = $rs->count;
$data{page} = $page;
$data{rows} = [
map { +{
@@ -172,7 +175,7 @@
$_->rating,
$_->author_list,
]
- } } $rs->all
+ } } $paged_rs->all
];
$self->status_ok($c, entity => \%data);
More information about the Catalyst-commits
mailing list