We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12e3792 commit afc9907Copy full SHA for afc9907
1 file changed
app/jobs/weekly_leaderboard_job.rb
@@ -7,7 +7,8 @@ def perform
7
end_time = Time.now.utc.end_of_week.end_of_day # Sunday at 23:59 UTC
8
9
leaderboard_data = Answer
10
- .where(created_at: start_time..end_time, is_correct: true)
+ .joins(:puzzle)
11
+ .where(created_at: start_time..end_time, is_correct: true, puzzles: { sent_at: start_time..end_time })
12
.group(:server_id, :user_id)
13
.order(Arel.sql("COUNT(*) DESC"))
14
.count
0 commit comments