Public schedule adapted to the new relations
Public schedule and all events adapted to the new relations and models to allow having several schedules in the admin shcedule.
This commit is contained in:
parent
8f3dcda2f7
commit
2aee0158f8
12 changed files with 70 additions and 60 deletions
|
|
@ -249,13 +249,6 @@ class Event < ActiveRecord::Base
|
|||
(100 * result.values.count(true) / result.values.compact.count).to_s
|
||||
end
|
||||
|
||||
##
|
||||
# Returns end of the event
|
||||
#
|
||||
def end_time
|
||||
self.scheduled_start_time + self.event_type.length.minutes
|
||||
end
|
||||
|
||||
##
|
||||
# Returns the room in which the event is scheduled
|
||||
#
|
||||
|
|
@ -270,25 +263,18 @@ class Event < ActiveRecord::Base
|
|||
selected_event_schedule.try(:start_time)
|
||||
end
|
||||
|
||||
##
|
||||
# Returns events that are scheduled in the same room and start_time as event
|
||||
#
|
||||
def intersecting_events
|
||||
room.events.where(start_time: start_time).where.not(id: id)
|
||||
end
|
||||
|
||||
# returns the event_schedule for this event and the schedule given in case that it exists
|
||||
def event_schedule(schedule_id)
|
||||
event_schedules.find_by(schedule_id: schedule_id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# returns the event_schedule for this event and for the selected_schedule
|
||||
def selected_event_schedule
|
||||
event_schedules.find_by(schedule_id: program.try(:selected_schedule))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
# Do not allow, for the event, more attendees than the size of the room
|
||||
def max_attendees_no_more_than_room_size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue