Skip to content

Commit

Permalink
Add eager loading on user controller show action
Browse files Browse the repository at this point in the history
  • Loading branch information
tsheporamantso committed Dec 19, 2023
1 parent dd2b3b5 commit 7e94941
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ def index
end

def show
@user = User.find(params[:id])
@user = User.includes(posts: :comments).find(params[:id])
end
end

0 comments on commit 7e94941

Please sign in to comment.