redding/mr — pull request #11 by jcredding (2013-05-08 19:58:47+00:00)
Title: Add a fake query and fake paged query for testing

Similar to the fake records, this provides fake alternatives to
the `Query` and `PagedQuery` objects. These are intended for
testing. They can be passed a simple collection of models and
will act like the real query or paged query objects. These can
be subbed in using stubbing to keep from expensive database
calls and setup.

#### Remove extra paging helpers from `PagedQuery`
This removes the paging helpers: `current_page`, `total_pages`,
and `last_page?` from `PagedQuery`. Their are 2 reasons for this.
The first reason is this is in preparation to support a fake
paged query and a limited interface is ideal for mimicing.
Otherwise, the logic for calculating the total pages or if this is
the last page would need to be commonized.

The primary reason is that though these methods can be helpful,
they are inefficient and are a crutch that should not be used.
The better practice is to wrap a paged query and cache it's
results (`total_count`, `count` and `models`). Then these values
can be calculated in an efficient manner.