mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
(bug) event reserved places compute error
This commit is contained in:
parent
7ba596c9b8
commit
5e46d8c45e
@ -1,5 +1,8 @@
|
||||
# Changelog Fab-manager
|
||||
|
||||
- Fix a bug: event reserved places compute error
|
||||
- [TODO DEPLOY] `rails fablab:setup:build_places_cache`
|
||||
|
||||
## v6.0.11 2023 July 21
|
||||
|
||||
- Fix a bug: incorrect date range in statistics
|
||||
|
@ -32,7 +32,11 @@ class Slots::PlacesCacheService
|
||||
|
||||
reserved_places = (reservations[:reservations].count || 0) + (pending[:reservations].count || 0)
|
||||
if slot.availability.available_type == 'event'
|
||||
reserved_places = slot.availability.event.nb_total_places - slot.availability.event.nb_free_places
|
||||
reserved_places = if slot.availability.event.nb_total_places.nil?
|
||||
0
|
||||
else
|
||||
slot.availability.event.nb_total_places - slot.availability.event.nb_free_places
|
||||
end
|
||||
end
|
||||
places.push({
|
||||
reservable_type: reservable.class.name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user