diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 91b557d1..89b7171a 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -54,7 +54,7 @@ class UserController < ApplicationController def questions @title = 'Questions' @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).includes(:profile).first! - @questions = @user.cursored_questions(author_is_anonymous: false, last_id: params[:last_id]) + @questions = @user.cursored_questions(author_is_anonymous: false, direct: false, last_id: params[:last_id]) @questions_last_id = @questions.map(&:id).min @more_data_available = !@user.cursored_questions(author_is_anonymous: false, last_id: @questions_last_id, size: 1).count.zero? diff --git a/app/models/user/question_methods.rb b/app/models/user/question_methods.rb index 468e984a..1c52f660 100644 --- a/app/models/user/question_methods.rb +++ b/app/models/user/question_methods.rb @@ -5,9 +5,9 @@ module User::QuestionMethods define_cursor_paginator :cursored_questions, :ordered_questions - def ordered_questions(author_is_anonymous: nil) + def ordered_questions(author_is_anonymous: nil, direct: nil) questions - .where({ author_is_anonymous: author_is_anonymous }.compact) + .where({ author_is_anonymous: author_is_anonymous, direct: direct }.compact) .order(:created_at) .reverse_order end diff --git a/lib/use_case/question/create.rb b/lib/use_case/question/create.rb index afdfb03c..6d20ff20 100644 --- a/lib/use_case/question/create.rb +++ b/lib/use_case/question/create.rb @@ -20,7 +20,8 @@ module UseCase content: content, author_is_anonymous: anonymous, author_identifier: author_identifier, - user: source_user_id.nil? ? nil : source_user + user: source_user_id.nil? ? nil : source_user, + direct: true ) return if filtered?(question)