1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

(bug) fix reservation reminder

This commit is contained in:
Sylvain 2022-07-26 15:41:03 +02:00
parent 07757e6adb
commit eaaf3b9a73

View File

@ -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,