diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-08 17:22:43 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-08 17:22:43 +0300 |
commit | 69bcef32e12cca8a4a31c3035509d479a712b504 (patch) | |
tree | 7ff4b1e444ba1ba470f5f2da29f168b3e487c672 /app/finders | |
parent | a2374758e34475ebdfacbe68b6c5b095b66262ec (diff) | |
parent | 4841e883020146fecd386caff7f31f2d9cf307b6 (diff) |
Merge remote-tracking branch 'public/trending-projects-performance'
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/trending_projects_finder.rb | 11 |
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 |