my $class = shift;\r
\r
my $rs = $class->search(@_);\r
- unless ($rs->{attrs}{page}) {\r
+ unless ($rs->{page}) {\r
$rs = $rs->page(1);\r
}\r
return ( $rs->pager, $rs );\r
cond => $attrs->{where},
from => $attrs->{from},
count => undef,
+ page => delete $attrs->{page},
pager => undef,
attrs => $attrs };
bless ($new, $class);
- #$new->pager if $attrs->{page};
return $new;
}
sub pager {
my ($self) = @_;
my $attrs = $self->{attrs};
- die "Can't create pager for non-paged rs" unless $attrs->{page};
+ die "Can't create pager for non-paged rs" unless $self->{page};
$attrs->{rows} ||= 10;
$self->count;
return $self->{pager} ||= Data::Page->new(
- $self->{count}, $attrs->{rows}, $attrs->{page});
+ $self->{count}, $attrs->{rows}, $self->{page});
}
=head2 page($page_num)