Extract checking if event is replacement to event_schedule model
This commit is contained in:
parent
e06f51b97e
commit
e3192a9547
4 changed files with 9 additions and 5 deletions
|
|
@ -28,4 +28,8 @@ class EventSchedule < ActiveRecord::Base
|
|||
def intersecting_events
|
||||
room.event_schedules.where(start_time: start_time, schedule: schedule).where.not(id: id)
|
||||
end
|
||||
|
||||
def replacement?
|
||||
event.state == 'confirmed' && (!intersecting_events.canceled.empty? || !intersecting_events.withdrawn.empty?)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue