Please sign in to comment.
Fix coercion error when offset_value is nil
This commit does two things: * Adds `.offset(0)` when limit is set to `nil` for consistency * Force-returns `1` for `#total_pages` and `#current_page` when using `per(nil)`. This avoid "Cannot coerce nil into Fixnum" errors, and will also prevent "ZeroDivisionError" if `limit_value` is ever typecast using `to_i`.
- Loading branch information...
Showing with 14 additions and 1 deletion.