Fix some more n+1 stuff
This commit is contained in:
parent
1f9788309b
commit
5c4eca47a6
2 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ class SubcredditsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@posts = @subcreddit.posts
|
@posts = @subcreddit.posts.includes(:user)
|
||||||
|
|
||||||
authorize @subcreddit
|
authorize @subcreddit
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
def show
|
def show
|
||||||
@user = User.friendly.find(params[:id])
|
@user = User.friendly.find(params[:id])
|
||||||
@comments = @user.comments.includes(:post)
|
@comments = @user.comments.includes(post: :subcreddit)
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
Loading…
Reference in a new issue