Merge pull request #931 from nishanthvijayan/fix-api-events-speakers
Fix api controllers events and speakers
This commit is contained in:
commit
c4e782a90c
4 changed files with 81 additions and 3 deletions
|
|
@ -5,10 +5,10 @@ module Api
|
|||
respond_to :json
|
||||
|
||||
def index
|
||||
events = Event.includes(:conference, :track, :room, :event_type, event_users: :user)
|
||||
events = Event.includes(:track, :room, :event_type, event_users: :user)
|
||||
|
||||
if @conference
|
||||
events = events.where(conference: @conference)
|
||||
events = events.where(program: @conference.program)
|
||||
end
|
||||
|
||||
respond_with events.confirmed
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ module Api
|
|||
|
||||
def index
|
||||
if @conference
|
||||
users = User.joins(event_users: { event: :conference })
|
||||
users = User.joins(event_users: { event: { program: :conference} })
|
||||
users = users.where(conferences: { short_title: @conference.short_title })
|
||||
else
|
||||
users = User.joins(:event_users)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue