diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index a35971ed..931d113c 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -94,9 +94,9 @@ class UserController < ApplicationController def questions @title = 'Questions' @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first! - @questions = @user.cursored_questions(last_id: params[:last_id]) + @questions = @user.cursored_questions(author_is_anonymous: false, last_id: params[:last_id]) @questions_last_id = @questions.map(&:id).min - @more_data_available = !@user.cursored_questions(last_id: @questions_last_id, size: 1).count.zero? + @more_data_available = !@user.cursored_questions(author_is_anonymous: false, last_id: @questions_last_id, size: 1).count.zero? end def data diff --git a/app/models/user/question_methods.rb b/app/models/user/question_methods.rb index 608efe6b..468e984a 100644 --- a/app/models/user/question_methods.rb +++ b/app/models/user/question_methods.rb @@ -5,8 +5,9 @@ module User::QuestionMethods define_cursor_paginator :cursored_questions, :ordered_questions - def ordered_questions + def ordered_questions(author_is_anonymous: nil) questions + .where({ author_is_anonymous: author_is_anonymous }.compact) .order(:created_at) .reverse_order end