Use load_async for loading pinned answers
This commit is contained in:
parent
e18abd3752
commit
8ac50878be
|
@ -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|
|
||||||
|
|
Loading…
Reference in New Issue