implementation in progress
This commit is contained in:
parent
f3db1288cf
commit
018bbff7b8
4 changed files with 12 additions and 2 deletions
|
|
@ -112,6 +112,14 @@ class ConferencesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def live_events
|
||||||
|
conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
|
temp = conference.find_live_events
|
||||||
|
p "TESTTEST"
|
||||||
|
p temp.size()
|
||||||
|
p temp.to_json()
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def conference_finder_conditions
|
def conference_finder_conditions
|
||||||
|
|
|
||||||
|
|
@ -784,7 +784,7 @@ class Conference < ApplicationRecord
|
||||||
end_date < Time.current
|
end_date < Time.current
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_live_events()
|
def find_live_events
|
||||||
live_events = []
|
live_events = []
|
||||||
for event in program.events
|
for event in program.events
|
||||||
if event.is_live?
|
if event.is_live?
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ class Event < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_live?
|
def is_live?
|
||||||
start_time >= Time.now && Time.now <= start_time + event_type.length
|
time() >= Time.now && Time.now <= time() + event_type.length
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,8 @@ Osem::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :conferences, only: [:index, :show] do
|
resources :conferences, only: [:index, :show] do
|
||||||
|
get 'live_events', to: 'conferences#live_events'
|
||||||
|
|
||||||
resources :booths do
|
resources :booths do
|
||||||
member do
|
member do
|
||||||
patch :withdraw
|
patch :withdraw
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue