+ $thing{makers} //= sub { shift->resultset($thing{rsname}) };
+ my $rs = $thing{makers}->(db $env)->search(undef, {order_by => 'me.id'});
+ if (my $page = $req->param('page')) {
+ my $pages = $rs->count / PAGE_SIZE;
+ $rs = $rs->search(undef, {offset => ($page - 1) * PAGE_SIZE, ($page == $pages ? () : (rows => PAGE_SIZE))});
+ }
+ $rs = $rs->search(undef, {prefetch => $thing{prefetch}}) if exists $thing{prefetch};
+ my @thing = map +{rs => $_, $_->get_columns}, $rs->all;