From 8f372bab04ca7013272837a49b7aa0d50cb607eb Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Fri, 15 Sep 2017 14:52:35 +0200 Subject: [PATCH] added total_entries attribute to fix pagination on more complicated query. Don't know why this is necessary. Fix was found by MGrundke --- app/controllers/request_for_comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/request_for_comments_controller.rb b/app/controllers/request_for_comments_controller.rb index fca5c99b..20d77bea 100644 --- a/app/controllers/request_for_comments_controller.rb +++ b/app/controllers/request_for_comments_controller.rb @@ -22,7 +22,7 @@ class RequestForCommentsController < ApplicationController request_for_comments.submission_id, request_for_comments.row_number') # ugly, but rails wants it this way .select('request_for_comments.*, max(comments.updated_at) as last_comment') .search(params[:q]) - @request_for_comments = @search.result.order('created_at DESC').paginate(page: params[:page]) + @request_for_comments = @search.result.order('created_at DESC').paginate(page: params[:page], total_entries: @search.result.length) authorize! end