From 8ac50878be020de74085b861d6737e4458ef4f8e Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 22 Oct 2023 21:52:04 +0200 Subject: [PATCH] Use load_async for loading pinned answers --- app/controllers/user_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 7a7be8ef..1e9940d4 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -8,7 +8,7 @@ class UserController < ApplicationController after_action :mark_notification_as_read, only: %i[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) } respond_to do |format|