Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-10-08 17:22:43 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-10-08 17:22:43 +0300
commit69bcef32e12cca8a4a31c3035509d479a712b504 (patch)
tree7ff4b1e444ba1ba470f5f2da29f168b3e487c672 /app/finders
parenta2374758e34475ebdfacbe68b6c5b095b66262ec (diff)
parent4841e883020146fecd386caff7f31f2d9cf307b6 (diff)
Merge remote-tracking branch 'public/trending-projects-performance'
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/trending_projects_finder.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/app/finders/trending_projects_finder.rb b/app/finders/trending_projects_finder.rb
index 9ea342cb26d..81a12403801 100644
--- a/app/finders/trending_projects_finder.rb
+++ b/app/finders/trending_projects_finder.rb
@@ -1,13 +1,6 @@
class TrendingProjectsFinder
- def execute(current_user, start_date = nil)
- start_date ||= Date.today - 1.month
-
- projects = projects_for(current_user)
-
- # Determine trending projects based on comments count
- # for period of time - ex. month
- projects.joins(:notes).where('notes.created_at > ?', start_date).
- group("projects.id").reorder("count(notes.id) DESC")
+ def execute(current_user, start_date = 1.month.ago)
+ projects_for(current_user).trending(start_date)
end
private