added total_entries attribute to fix pagination on more complicated query. Don't know why this is necessary. Fix was found by MGrundke

This commit is contained in:
Ralf Teusner
2017-09-15 14:52:35 +02:00
parent 9ce29d211b
commit 8f372bab04

View File

@ -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