1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-22 11:52:21 +01:00

Merge branch 'pre_inscription' into staging

This commit is contained in:
Du Peng 2023-07-24 18:15:31 +02:00
commit 1554b7f545

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)