codeRIT/hackathon_manager

View on GitHub
app/jobs/staff_weekly_report_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class StaffWeeklyReportJob < ApplicationJob
  queue_as :default

  def perform
    # Queue all eligible users and let the is_active (or other) logic determine if they should really receive it
    users = User.where(receive_weekly_report: true)
    users.each do |user|
      StaffMailer.weekly_report(user.id).deliver_later
    end
  end
end