mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #1082 from nishanthvijayan/handle-cancelled-events
Handle cancellation of scheduled events
This commit is contained in:
commit
96155eb87f
5 changed files with 50 additions and 0 deletions
|
|
@ -38,6 +38,8 @@ class Event < ActiveRecord::Base
|
|||
validate :max_attendees_no_more_than_room_size
|
||||
|
||||
scope :confirmed, -> { where(state: 'confirmed') }
|
||||
scope :canceled, -> { where(state: 'canceled') }
|
||||
scope :withdrawn, -> { where(state: 'withdrawn') }
|
||||
scope :highlighted, -> { where(is_highlight: true) }
|
||||
|
||||
state_machine initial: :new do
|
||||
|
|
@ -246,6 +248,13 @@ class Event < ActiveRecord::Base
|
|||
self.start_time + self.event_type.length.minutes
|
||||
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
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue