1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

(bug) create slots when occurences is nil

This commit is contained in:
Sylvain 2022-07-18 17:27:40 +02:00
parent 6a8c441e85
commit e955ecc6f8

View File

@ -2,7 +2,9 @@
# Provides an helper method to create the slots for an Availability and optionnaly, for its multiple occurrences
class Availabilities::CreateAvailabilitiesService
def create(availability, occurrences = [])
def create(availability, occurrences)
occurrences = [] if occurrences.nil?
availability.update_attributes(occurrence_id: availability.id)
create_slots(availability)