Order pinned answers by when they were pinned

This commit is contained in:
Karina Kwiatek 2023-02-10 22:23:34 +01:00
parent 854cf2662e
commit 6724aef105
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ class UserController < ApplicationController
def show
@answers = @user.cursored_answers(last_id: params[:last_id])
@pinned_answers = @user.answers.pinned.limit(10)
@pinned_answers = @user.answers.pinned.order(pinned_at: :desc).limit(10)
@answers_last_id = @answers.map(&:id).min
@more_data_available = !@user.cursored_answers(last_id: @answers_last_id, size: 1).count.zero?