Merge pull request #29 from Retrospring/feature-discover

Only show new users that have asked at least 1 question (Discover)
This commit is contained in:
Georg G. 2015-05-15 12:14:40 +02:00
commit 64a7450b28
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ class DiscoverController < ApplicationController
@popular_answers = Answer.where("created_at > ?", Time.now.ago(1.week)).order(:smile_count).reverse_order.limit(top_x) @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) @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 # .user = the user
# .question_count = how many questions did the user ask # .question_count = how many questions did the user ask