Use load_async for loading pinned answers

This commit is contained in:
Karina Kwiatek 2023-10-22 21:52:04 +02:00
parent e18abd3752
commit 8ac50878be
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class UserController < ApplicationController
after_action :mark_notification_as_read, only: %i[show] after_action :mark_notification_as_read, only: %i[show]
def show def show
@pinned_answers = @user.answers.pinned.includes([{ user: :profile }, :question]).order(pinned_at: :desc).limit(10) @pinned_answers = @user.answers.pinned.includes([{ user: :profile }, :question]).order(pinned_at: :desc).limit(10).load_async
paginate_answers { |args| @user.cursored_answers(**args) } paginate_answers { |args| @user.cursored_answers(**args) }
respond_to do |format| respond_to do |format|