Skip to content

Commit

Permalink
only apply per-page navigation.records config limit if defined
Browse files Browse the repository at this point in the history
Closes #46
  • Loading branch information
SysPete committed May 12, 2015
1 parent 12c11b0 commit 7e0d5e6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/Dancer/Plugin/Interchange6/Routes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,17 @@ sub _setup_routes {
->search_related('product')
->active
->listing( { users_id => session('logged_in_user_id') } )
->order_by('!me.priority,!product.priority')
->rows( $routes_config->{navigation}->{records} )
->page( $tokens->{page} );
->order_by('!me.priority,!product.priority');

if ( defined $routes_config->{navigation}->{records} ) {

# records per page is set in configuration so page the
# result set

$products =
$products->rows( $routes_config->{navigation}->{records} )
->page( $tokens->{page} );
}

# get a pager

Expand Down

0 comments on commit 7e0d5e6

Please sign in to comment.