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

(bug) cannot create slot

This commit is contained in:
Du Peng 2023-07-24 18:13:34 +02:00
parent aa6aab48b2
commit 768b5d7e0e

View File

@ -19,7 +19,9 @@ class Slots::ReservationsService
.where('reservations.reservable_type': reservable_types)
.where('reservations.reservable_id': reservables.map { |r| r.try(:id) })
.where('slots_reservations.canceled_at': nil)
reservations = reservations.where('slots_reservations.is_valid': true) if reservables.first&.pre_registration?
if reservables.first.is_a?(Event) && reservables.first&.pre_registration?
reservations = reservations.where('slots_reservations.is_valid': true)
end
user_ids = reservations.includes(reservation: :statistic_profile)
.map(&:reservation)