amatsuda/kaminari — pull request #585 by gsamokovarov (2014-07-30 15:05:19+00:00)
Title: Clear paginatable array if initialised with limit <= 0

Previously, if you do that, calls to`#per`, `#total_pages` and `#current_page` blowed up with:

```
ZeroDivisionError: divided by 0
```

I had such an error in the template of a legacy application, which initialised a fallback paginatable array with zero limit, offset, etc and the zero devision error got thrown out in the view. Tracking it down was quite troublesome.

The current solution tries to emulate the databases, which returns a null set when `LIMIT 0` is given. This leads to some tricky semantics about how much pages should we have, etc, so I just return 1 `#total_pages` and `#current_page`.

I'm also fine with raising an early exception while initialising the paginatable array.