Merge pull request #1410 from Retrospring/feature/load-async-pinned-answers

This commit is contained in:
Karina Kwiatek 2023-10-23 07:54:05 +02:00 committed by GitHub
commit e351990475
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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|