amatsuda/kaminari — pull request #359 by vladimir-vg (2013-02-21 22:05:49+00:00)
Title: Fix wrong pagination when used with padding

Pagination just breaks when used with `padding`, because `total_pages` and `current_page` doesn't checks is padding used.

For example:

```ruby
source = [
# padding
1, 2, 3, 4,

# first page
5, 6, 7,

# second
8, 9,
]
arr = Kaminari.paginate_array(source).page(2).per(3).padding(4)

puts arr.inspect
# => [8, 9] which is correct

puts arr.total_pages # => 3
# whoops, that's wrong, 2 was expected

puts arr.current_page # => 3
# also wrong, 2 was expected
```

Array used just for example, I encounter same problem when work with active record.

I fixed it, but probably it can be written in more sound style to the rest of code.