<commit_before># Sends notifications of meals that people have signed up for.
# Checks the DB to see when to send.
class MealReminderJob < ReminderJob
  def perform
    return unless correct_hour?

    lead_days = Settings.reminder_lead_times.meal
    raise "No lead time found in settings for meal notification" if lead_days.blank?

    meal_ids = Meal.served_within_days_from_now(lead_days).pluck(:id)

    if meal_ids.any?
      # Find all households for target meals that have not yet been notified.
      signups = Signup.where(meal_id: meal_ids).where(notified: false).includes(household: :users)

      # Send emails
      signups.each do |signup|
        signup.household_users.each do |user|
          NotificationMailer.meal_reminder(user, signup).deliver_now
        end
        signup.update_attribute(:notified, true)
      end
    end
  end
end<commit_msg>Quick fix<commit_after># Sends notifications of meals that people have signed up for.
# Checks the DB to see when to send.
class MealReminderJob
  def perform
    return unless correct_hour?

    lead_days = Settings.reminder_lead_times.meal
    raise "No lead time found in settings for meal notification" if lead_days.blank?

    meal_ids = Meal.served_within_days_from_now(lead_days).pluck(:id)

    if meal_ids.any?
      # Find all households for target meals that have not yet been notified.
      signups = Signup.where(meal_id: meal_ids).where(notified: false).includes(household: :users)

      # Send emails
      signups.each do |signup|
        signup.household_users.each do |user|
          NotificationMailer.meal_reminder(user, signup).deliver_now
        end
        signup.update_attribute(:notified, true)
      end
    end
  end

  def correct_hour?
    Time.zone.now.hour == Settings.reminder_time_of_day
  end

  def max_attempts
    1
  end

  def error(job, exception)
    ExceptionNotifier.notify_exception(exception)
  end

end
{'fraction_non_alphanumeric': 0.0686427457098284, 'fraction_numerical': 0.0005200208008320333, 'mean_word_length': 3.31390134529148, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5975374', 'n_tokens_mistral': 614, 'n_tokens_neox': 588, 'n_words': 171}