FIX: Remove N+1 queries in posts.json
This commit is contained in:
parent
32e5016dbb
commit
27ee8bea95
|
@ -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…
Reference in New Issue