mislav/will_paginate — pull request #250 by HurricaneJames (2012-07-05 21:56:38+00:00)
Title: Set :total_entries < 0 for uncounted paging.

Pagination on really large data sets is very slow because of the count(*) requirement to find number of pages. This can be fixed by setting :total_entries to the correct size. However, if you do not know what that is supposed to be you are stuck approximating.

This patch makes it possible to have just previous/next links whenever there are pages behind/ahead by setting :total_entries to -1. I figure -1 is a pretty good value for "I have no idea how many there are, but I DON'T want you counting either!"

There is one caveat with this method. The last page may be blank if the next to last page has the last item and is full.