implement changes from https://github.com/amatsuda/kaminari/pull/115/files