Array#paginate is inconsistent with collection#paginate
Reported by ckknight | October 10th, 2007 @ 11:40 PM
Currently, Array#paginate's API is in the form of
[1,2,3].paginate(page=1, per_page=15)
whereas Rails' collections use the form
myCollection.paginate(:page => 1, :per_page => 30, :total_entries => num)
Now there's multiple issues with this:
1) using a tuple of options instead hash-style options
2) different per_page
3) Depending on the environment (e.g. test vs. development), one method can return an Array while in test or a collection in development.
I've attached a diff of what I think should allay this issue.
Comments and changes to this ticket
-
Mislav October 13th, 2007 @ 03:17 AM
- Assigned user changed from Chris Wanstrath to Mislav
- State changed from new to open
-
Chris Wanstrath October 14th, 2007 @ 01:50 AM
(from [406]) Will Paginate: add WillPaginate::Deprecation that builds on ActiveSupport::Deprecation. Change Array#paginate API to match ActiveRecord::Base#paginate; so you will no longer write array.paginate(1, 20), but array.paginate(:page => 1, :per_page => 20). Mark the old API as deprecated; it will be removed in the future. [ckknight] [#128 status:resolved]
-
Mislav October 14th, 2007 @ 01:52 AM
- State changed from open to resolved
Why didn't the commit hook close this, I wonder
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Everyone's favorite Ruby library for pagination of practically anything!