-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added pagination to limit the revisions of a wiki page #2707
Conversation
298b1a0
to
cedef21
Compare
Generated by 🚫 Danger |
@jywarren Any idea how to test pagination ? |
@@ -266,9 +266,10 @@ def revisions | |||
@node = Node.find_wiki(params[:id]) | |||
if @node | |||
@revisions = @node.revisions | |||
@revisions = @revisions.where(status: 1) unless current_user && current_user.can_moderate? | |||
@revisions = @revisions.where(status: 1).page(params[:page]).per_page(20) unless current_user && current_user.can_moderate? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh aha - so this unless
condition turns off the pagination, right? So then we have to be sure not to treat the collection as paginated. You could add the same condition to line 272?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh! 😅 Ya you are right!
…evision Tab to 20
cedef21
to
b9fadb5
Compare
All test passed! |
SUPER!!!!!! This is great. @steviepubliclab will be happy - this solves the "zillion revisions" problem. |
…evision Tab to 20 (publiclab#2707)
Closes #2699
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
fixes #0000
-style reference to original issue #@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.
Thanks!