-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignores :order
option.
#573
Comments
This is bug for 3 years! It not works in Rails 4 too. Example:
It always sort invoices like created_at ASC. In will_paginate for Rails 2 same part of code works like a charm ;-) |
Is there a fix?? |
I ran into a similar problem with our Rails 5.1 app. We were facing an issue where the last record of page 1, would show as the first record on page 2 if we were attempting to I opted to do a side-by-side comparison. One using the NB: The numbers in the tables here refer to the index of the object in the base collection Example for Page 1 ComparisonPaginated method def paginated_collection
collection.order('first_name').paginate(page: 1, per_page: 15)
end Array#slice method def sliced_array_collection
collection.to_ary.sort_by(&:first_name).slice(0..14)
end Example for Page 2 ComparisonPaginated method def paginated_collection
collection.order('first_name').paginate(page: 2, per_page: 15)
end Array#slice method def sliced_array_collection
collection.to_ary.sort_by(&:first_name).slice(15..29)
end |
The
paginate
method seems to ignore:order
option which is provided viaset_default_order
method inHobo::Model
.The text was updated successfully, but these errors were encountered: