Skip to content

Commit

Permalink
Update send_organizer_summaries_job.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Almeida <[email protected]>
  • Loading branch information
sampoder and northeastprince authored Nov 11, 2023
1 parent af8f7ed commit 728b784
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/jobs/hackathons/send_organizer_summaries_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class Hackathons::SendOrganizerSummariesJob < ApplicationJob
def perform(sent_digests)
# This reloads the (possible) sent_digests array as an
# ActiveRecord::Relation so that we can use includes to prevent an N+1.
@sent_digests = Hackathon::Digest.where(id: sent_digests.map(&:id)) ||
Hackathon::Digest.where(created_at: 6.days.ago...Time.now)
@sent_digests = Hackathon::Digest.where(id: sent_digests.map(&:id))

@sent_digests_by_hackathons = @sent_digests
.includes(listings: {hackathon: {logo_attachment: :blob}})
Expand Down

0 comments on commit 728b784

Please sign in to comment.