app/models/events/event_time.rb
def full?
    if capacity.to_i.zero? # unlimited cap for this timeslot; check if there is an event-wide cap
      return event.capacity.to_i.zero? ? false : event.attendees.size >= event.capacity
    else # there is a timeslot cap; check both timeslot count and event-wide count
      return attendees.size >= capacity ? true : event.attendees.size >= (event.capacity.to_i.zero? ? 1e5 : event.capacity)
    end
  end
# Returns true if this event time is full. An event time is full if adding another attendee to the EventTime would cause
# the EventTime to be over capacity (as defined by <tt>EventTime#capacity</tt>). Or, if <tt>Event#capacity</tt> is defined, 
# then we base this calculation off whichever number is less. This allows you to define an event, say, where each timeslot can
# only support 5 attendees each and all of the timeslots cannot total more than 50 attendees.
# 
# Note that this method does *not* take into account invitee guests (<tt>EventInvitee#number_of_guests</tt>).
Returns true if this event time is full. An event time is full if adding another attendee to the EventTime would cause
the EventTime to be over capacity (as defined by EventTime#capacity). Or, if Event#capacity is defined,
then we base this calculation off whichever number is less. This allows you to define an event, say, where each timeslot can
only support 5 attendees each and all of the timeslots cannot total more than 50 attendees.

Note that this method does *not* take into account invitee guests (EventInvitee#number_of_guests).
Returns true if this event time is full . An event time is full if adding another attendee to the EventTime would cause the EventTime to be over capacity ( as defined by EventTime#capacity ) . Or if Event#capacity is defined then we base this calculation off whichever number is less . This allows you to define an event say where each timeslot can only support 5 attendees each and all of the timeslots cannot total more than 50 attendees . Note that this method does * not * take into account invitee guests ( EventInvitee#number_of_guests ) .
def full?
    if capacity.to_i.zero? 
      return event.capacity.to_i.zero? ? false : event.attendees.size >= event.capacity
    else 
      return attendees.size >= capacity ? true : event.attendees.size >= (event.capacity.to_i.zero? ? 1e5 : event.capacity)
    end
  end
def full? if capacity . to_i . zero? return event . capacity . to_i . zero? ? false : event . attendees . size >= event . capacity else return attendees . size >= capacity ? true : event . attendees . size >= ( event . capacity . to_i . zero? ? 1e5 : event . capacity ) end end
Returns true if this event time is full.
Returns true if this event time is full .
# unlimited cap for this timeslot; check if there is an event-wide cap # there is a timeslot cap; check both timeslot count and event-wide count