Force notes list to be realised in notes#mine
There is a rails bug which means that using count on a relation that uses uniq and offset/limit and which hasn't been realised yet will always return one, so force it to be realised.
This commit is contained in:
parent
82f8968169
commit
cc8bfc07bb
1 changed files with 1 additions and 1 deletions
|
@ -279,7 +279,7 @@ class NotesController < ApplicationController
|
|||
@description = t 'note.mine.subheading', :user => render_to_string(:partial => "user", :object => @this_user)
|
||||
@page = (params[:page] || 1).to_i
|
||||
@page_size = 10
|
||||
@notes = @this_user.notes.order("updated_at DESC, id").uniq.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author)
|
||||
@notes = @this_user.notes.order("updated_at DESC, id").uniq.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author).all
|
||||
else
|
||||
@title = t 'user.no_such_user.title'
|
||||
@not_found_user = params[:display_name]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue