From 5ce831d4da9e6eb81422a025dd1731ea6b9e5f9f Mon Sep 17 00:00:00 2001 From: r888888888 Date: Sun, 30 Jun 2013 23:43:20 -0700 Subject: [PATCH] fix user promotion report --- app/logical/reports/user_promotions.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/logical/reports/user_promotions.rb b/app/logical/reports/user_promotions.rb index bf3ca7a64..3fe16ae27 100644 --- a/app/logical/reports/user_promotions.rb +++ b/app/logical/reports/user_promotions.rb @@ -23,9 +23,7 @@ module Reports end def users - User.with_timeout(30_000) do - User.joins(:posts).where("users.level < ? and users.post_upload_count >= 100", User::Levels::CONTRIBUTOR).where("posts.created_at >= ? and posts.fav_count >= 1", self.class.min_time).order("users.id").select("distinct users.id") - end + User.where("users.level < ? and users.post_upload_count >= 100", User::Levels::CONTRIBUTOR).order("created_at desc").limit(50) end end end