diff --git a/app/controllers/api/v1/events_controller.rb b/app/controllers/api/v1/events_controller.rb index e654f167..229c264a 100644 --- a/app/controllers/api/v1/events_controller.rb +++ b/app/controllers/api/v1/events_controller.rb @@ -4,9 +4,9 @@ module Api respond_to :json def index - events = Event.includes(:conference, :track, :room, :event_type, event_user: :user) + events = Event.includes(:conference, :track, :room, :event_type, event_users: :user) unless params[:conference_id].blank? - events = events.where('conferences.guid' => params[:conference_id]) + events = events.where(conferences: { guid: params[:conference_id] }) end respond_with events.confirmed end diff --git a/app/controllers/api/v1/speakers_controller.rb b/app/controllers/api/v1/speakers_controller.rb index cbf298d4..5166ed71 100644 --- a/app/controllers/api/v1/speakers_controller.rb +++ b/app/controllers/api/v1/speakers_controller.rb @@ -8,9 +8,9 @@ module Api users = User.joins(:event_users) else users = User.joins(event_users: { event: :conference }) - users = users.where('conferences.guid' => params[:conference_id]) + users = users.where(conferences: { guid: params[:conference_id] }) end - users = users.where('event_users.event_role' => 'speaker') + users = users.where(event_users: {event_role: :speaker}) render json: users, each_serializer: SpeakerSerializer end end diff --git a/app/controllers/api/v1/tracks_controller.rb b/app/controllers/api/v1/tracks_controller.rb index b196dc03..ba09bb59 100644 --- a/app/controllers/api/v1/tracks_controller.rb +++ b/app/controllers/api/v1/tracks_controller.rb @@ -8,7 +8,7 @@ module Api tracks = Track.all else tracks = Track.joins(:conference) - tracks = tracks.where("conferences.guid" => params[:conference_id]) + tracks = tracks.where(conferences: { guid: params[:conference_id] }) end respond_with tracks end diff --git a/app/controllers/schedule_controller.rb b/app/controllers/schedule_controller.rb index e9d60d1a..85aa6d19 100644 --- a/app/controllers/schedule_controller.rb +++ b/app/controllers/schedule_controller.rb @@ -3,7 +3,9 @@ class ScheduleController < ApplicationController layout "application" def index - @conference = Conference.includes(:rooms, events: [:speakers, :track, :event_type]).where("conferences.short_title" => params[:conference_id]).first + @conference = Conference. + includes(:rooms, events: [:speakers, :track, :event_type]). + where(conferences: { short_title: params[:conference_id] }).first @rooms = @conference.rooms @events = @conference.events @dates = @conference.start_date..@conference.end_date diff --git a/app/serializers/speaker_serializer.rb b/app/serializers/speaker_serializer.rb index 3dfc87d7..64fb8936 100644 --- a/app/serializers/speaker_serializer.rb +++ b/app/serializers/speaker_serializer.rb @@ -1,7 +1,7 @@ class SpeakerSerializer < ActiveModel::Serializer include ActionView::Helpers::TextHelper - attributes :guid, :name, :affiliation, :biography + attributes :name, :affiliation, :biography def name object.name