mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Track Schedule and EventSchedule
This commit is contained in:
parent
b982d18bbb
commit
7d70f7685e
5 changed files with 44 additions and 6 deletions
|
|
@ -3,6 +3,8 @@ class EventSchedule < ActiveRecord::Base
|
|||
belongs_to :event
|
||||
belongs_to :room
|
||||
|
||||
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
|
||||
|
||||
validates :schedule, presence: true
|
||||
validates :event, presence: true
|
||||
validates :room, presence: true
|
||||
|
|
@ -28,4 +30,10 @@ class EventSchedule < ActiveRecord::Base
|
|||
def intersecting_events
|
||||
room.event_schedules.where(start_time: start_time, schedule: schedule).where.not(id: id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def conference_id
|
||||
schedule.program.conference_id
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue