This commit is contained in:
Anitha Palanisamy 2017-01-31 13:57:04 +00:00 committed by GitHub
commit f1e37df5a0
21 changed files with 264 additions and 3 deletions

View file

@ -14,6 +14,7 @@ class EventSchedule < ActiveRecord::Base
scope :confirmed, -> { joins(:event).where('state = ?', 'confirmed') }
scope :canceled, -> { joins(:event).where('state = ?', 'canceled') }
scope :withdrawn, -> { joins(:event).where('state = ?', 'withdrawn') }
scope :current, -> { where('start_time <= ?', Time.current).select{ |es| es.end_time >= Time.current }}
delegate :guid, to: :room, prefix: true