Created
May 23, 2016 10:07
-
-
Save sonalkr132/276b7163b1198a1b79c5f5d69cf8e6d4 to your computer and use it in GitHub Desktop.
used on blog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project.joins(“LEFT OUTER JOIN comments | |
ON comments.polycomment_id = projects.id | |
AND comments.polycomment_type=’project’ | |
LEFT OUTER JOIN issues ON issues.project_id = projects.id | |
AND issues.status=1”) | |
.where(‘comments.created_at > ? | |
OR issues.updated_at > ?’, 10.days.ago, 10.days.ago) | |
.group(‘projects.id’) | |
.order(‘count(comments.polycomment_id)+4*count(issues.project_id) | |
desc’) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment