Merge remote-tracking branch 'origin/pr/28'

This commit is contained in:
Petko Bordjukov 2016-11-17 18:59:56 +02:00
commit e8a575bd50
7 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,6 @@
class Api::EventTypesController < Api::ApplicationController class Api::EventTypesController < Api::ApplicationController
include ::CurrentConferenceAssigning include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference! before_filter :require_current_conference!
def index def index

View File

@ -1,5 +1,6 @@
class Api::EventsController < Api::ApplicationController class Api::EventsController < Api::ApplicationController
include ::CurrentConferenceAssigning include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference! before_filter :require_current_conference!
def index def index

View File

@ -1,5 +1,6 @@
class Api::HallsController < Api::ApplicationController class Api::HallsController < Api::ApplicationController
include ::CurrentConferenceAssigning include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference! before_filter :require_current_conference!
def index def index

View File

@ -1,5 +1,6 @@
class Api::SlotsController < Api::ApplicationController class Api::SlotsController < Api::ApplicationController
include ::CurrentConferenceAssigning include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference! before_filter :require_current_conference!
def index def index

View File

@ -1,5 +1,6 @@
class Api::SpeakersController < Api::ApplicationController class Api::SpeakersController < Api::ApplicationController
include ::CurrentConferenceAssigning include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference! before_filter :require_current_conference!
def index def index

View File

@ -1,5 +1,6 @@
class Api::TracksController < Api::ApplicationController class Api::TracksController < Api::ApplicationController
include ::CurrentConferenceAssigning include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference! before_filter :require_current_conference!
def index def index

View File

@ -0,0 +1,15 @@
require 'active_support/concern'
module PublicApiExposing
extend ActiveSupport::Concern
def set_access_control_headers
if request.format.json?
response.headers['Access-Control-Allow-Origin'] = '*'
end
end
included do
before_action :set_access_control_headers
end
end