osem-fcy/app/controllers/api/v1/events_controller.rb

16 lines
407 B
Ruby
Raw Normal View History

2014-06-26 15:43:24 +03:00
module Api
module V1
class EventsController < Api::BaseController
respond_to :json
2013-07-08 10:07:12 +02:00
2014-06-26 15:43:24 +03:00
def index
2014-08-27 16:18:35 +02:00
events = Event.includes(:conference, :track, :room, :event_type, event_users: :user)
2014-06-26 15:43:24 +03:00
unless params[:conference_id].blank?
2014-08-27 16:18:35 +02:00
events = events.where(conferences: { guid: params[:conference_id] })
2014-06-26 15:43:24 +03:00
end
respond_with events.confirmed
end
2013-07-08 10:07:12 +02:00
end
end
end