1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-12 06:54:19 +01:00

19 lines
589 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# A Time range, slicing an Availability.
# Slots duration are defined globally by Setting.get('slot_duration') but can be
# overridden per availability.
2020-03-25 10:16:47 +01:00
class Slot < ApplicationRecord
2016-03-23 18:39:41 +01:00
include NotifyWith::NotificationAttachedObject
has_many :slots_reservations, dependent: :destroy
has_many :reservations, through: :slots_reservations
2016-03-23 18:39:41 +01:00
belongs_to :availability
attr_accessor :is_reserved, :machine, :space, :title, :can_modify, :current_user_slots_reservations_ids
2016-03-23 18:39:41 +01:00
def complete?
reservations.length >= availability.nb_total_places
end
2016-03-23 18:39:41 +01:00
end