From eaaf3b9a73fe7d727f029989e39263402cd8d429 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 26 Jul 2022 15:41:03 +0200 Subject: [PATCH] (bug) fix reservation reminder --- app/workers/reservation_reminder_worker.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/workers/reservation_reminder_worker.rb b/app/workers/reservation_reminder_worker.rb index 2967fa7a6..843990f29 100644 --- a/app/workers/reservation_reminder_worker.rb +++ b/app/workers/reservation_reminder_worker.rb @@ -15,7 +15,9 @@ class ReservationReminderWorker starting = DateTime.current.beginning_of_hour + delay ending = starting + 1.hour - Reservation.joins(:slots).where('slots.start_at >= ? AND slots.start_at <= ? AND slots.canceled_at IS NULL', starting, ending).each do |r| + Reservation.joins(slots_reservations: :slot) + .where('slots.start_at >= ? AND slots.start_at <= ? AND slots_reservations.canceled_at IS NULL', starting, ending) + .each do |r| already_sent = Notification.where( attached_object_type: Reservation.name, attached_object_id: r.id,