mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-28 15:50:09 -04:00
FIX: Remove N+1 queries in posts.json
This commit is contained in:
parent
32e5016dbb
commit
27ee8bea95
1 changed files with 2 additions and 1 deletions
|
@ -37,7 +37,8 @@ class PostsController < ApplicationController
|
|||
.where('posts.id <= ?', last_post_id)
|
||||
.where('posts.id > ?', last_post_id - 50)
|
||||
.includes(topic: :category)
|
||||
.includes(:user)
|
||||
.includes(user: :primary_group)
|
||||
.includes(:reply_to_user)
|
||||
.limit(50)
|
||||
# Remove posts the user doesn't have permission to see
|
||||
# This isn't leaking any information we weren't already through the post ID numbers
|
||||
|
|
Loading…
Add table
Reference in a new issue