Limit to 10 pinned answers
This commit is contained in:
parent
de73532bef
commit
fa68ab27d7
|
@ -7,6 +7,7 @@ class UserController < ApplicationController
|
|||
|
||||
def show
|
||||
@answers = @user.cursored_answers(last_id: params[:last_id])
|
||||
@pinned_answers = @user.answers.pinned.limit(10)
|
||||
@answers_last_id = @answers.map(&:id).min
|
||||
@more_data_available = !@user.cursored_answers(last_id: @answers_last_id, size: 1).count.zero?
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- unless @user.banned?
|
||||
#pinned-answers
|
||||
- @user.answers.pinned.each do |a|
|
||||
- @pinned_answers.each do |a|
|
||||
= render "answerbox", a:
|
||||
|
||||
#answers
|
||||
|
|
Loading…
Reference in New Issue