From 6c48e47f2c9f5b4f82ff00a2c99467e40fd05551 Mon Sep 17 00:00:00 2001 From: Yuki Date: Fri, 15 May 2015 10:25:26 +0530 Subject: [PATCH] Only show people that have asked at least 1 question (Discover) --- app/controllers/discover_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/discover_controller.rb b/app/controllers/discover_controller.rb index 7eac7f55..576dcc3e 100644 --- a/app/controllers/discover_controller.rb +++ b/app/controllers/discover_controller.rb @@ -1,12 +1,12 @@ class DiscoverController < ApplicationController before_filter :authenticate_user! - + def index top_x = 10 # only display the top X items @popular_answers = Answer.where("created_at > ?", Time.now.ago(1.week)).order(:smile_count).reverse_order.limit(top_x) @popular_questions = Question.where("created_at > ?", Time.now.ago(1.week)).order(:answer_count).reverse_order.limit(top_x) - @new_users = User.order(:id).reverse_order.limit(top_x) + @new_users = User.where("asked_count > 0").order(:id).reverse_order.limit(top_x) # .user = the user # .question_count = how many questions did the user ask