1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/models/slots_reservation.rb

14 lines
319 B
Ruby
Raw Normal View History

class SlotsReservation < ActiveRecord::Base
belongs_to :slot
belongs_to :reservation
after_destroy :cleanup_slots
# when the SlotsReservation is deleted (from Reservation destroy cascade), we delete the
# corresponding slot
def cleanup_slots
unless slot.destroying
slot.destroy
end
end
end