Fix api/v1/events and api/v1/speakers controllers
This commit is contained in:
parent
39a850cc39
commit
22714b0f11
2 changed files with 3 additions and 3 deletions
|
|
@ -5,10 +5,10 @@ module Api
|
||||||
respond_to :json
|
respond_to :json
|
||||||
|
|
||||||
def index
|
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
|
if @conference
|
||||||
events = events.where(conference: @conference)
|
events = events.where(program: @conference.program)
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_with events.confirmed
|
respond_with events.confirmed
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ module Api
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if @conference
|
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 })
|
users = users.where(conferences: { short_title: @conference.short_title })
|
||||||
else
|
else
|
||||||
users = User.joins(:event_users)
|
users = User.joins(:event_users)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue