forked from openSUSE/osem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8990bf
commit fc75328
Showing
14 changed files
with
180 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
class Api::V1::EventsController < Api::BaseController | ||
respond_to :json | ||
module Api | ||
module V1 | ||
class EventsController < Api::BaseController | ||
respond_to :json | ||
|
||
def index | ||
events = Event.includes(:conference, :track, :room, :event_type, {:event_user => :user}) | ||
unless params[:conference_id].blank? | ||
events = events.where("conferences.guid" => params[:conference_id]) | ||
def index | ||
events = Event.includes(:conference, :track, :room, :event_type, event_user: :user) | ||
unless params[:conference_id].blank? | ||
events = events.where('conferences.guid' => params[:conference_id]) | ||
end | ||
respond_with events.confirmed | ||
end | ||
end | ||
respond_with events.confirmed | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
class Api::V1::SpeakersController < Api::BaseController | ||
respond_to :json | ||
module Api | ||
module V1 | ||
class SpeakersController < Api::BaseController | ||
respond_to :json | ||
|
||
def index | ||
if params[:conference_id].blank? | ||
people = User.joins(:event_users) | ||
else | ||
people = User.joins(:event_users => {:event => :conference}) | ||
people = people.where("conferences.guid" => params[:conference_id]) | ||
def index | ||
if params[:conference_id].blank? | ||
users = User.joins(:event_users) | ||
else | ||
users = User.joins(event_users: { event: :conference }) | ||
users = users.where('conferences.guid' => params[:conference_id]) | ||
end | ||
users = users.where('event_users.event_role' => 'speaker') | ||
render json: users, each_serializer: SpeakerSerializer | ||
end | ||
end | ||
people = people.where("event_users.event_role" => "speaker") | ||
render :json => users, :each_serializer => SpeakerSerializer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.