before_filter -> before_action

This commit is contained in:
Petko Bordjukov 2019-04-28 02:15:39 +03:00
parent a7c9c83e02
commit 69f4c4dc26
11 changed files with 11 additions and 11 deletions

View File

@ -1,7 +1,7 @@
class Api::EventTypesController < Api::ApplicationController
include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference!
before_action :require_current_conference!
def index
@event_types = current_conference.event_types.includes(:translations)

View File

@ -1,7 +1,7 @@
class Api::EventsController < Api::ApplicationController
include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference!
before_action :require_current_conference!
def index
@events = current_conference.events.approved.joins(:proposition).includes(:participations)

View File

@ -1,7 +1,7 @@
class Api::HallsController < Api::ApplicationController
include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference!
before_action :require_current_conference!
def index
@halls = current_conference.halls

View File

@ -1,7 +1,7 @@
class Api::SlotsController < Api::ApplicationController
include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference!
before_action :require_current_conference!
def index
@slots = current_conference.slots

View File

@ -1,7 +1,7 @@
class Api::SpeakersController < Api::ApplicationController
include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference!
before_action :require_current_conference!
def index
@speakers = PersonalProfile.joins(user: {participations: {event: :proposition}}).where(events: {id: current_conference.approved_events.pluck(:id)}, conference: current_conference).distinct

View File

@ -1,7 +1,7 @@
class Api::TracksController < Api::ApplicationController
include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference!
before_action :require_current_conference!
def index
@tracks = current_conference.tracks.includes(:translations)

View File

@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_locale
before_action :set_view_paths

View File

@ -1,7 +1,7 @@
module Public
class ApplicationController < ::ApplicationController
include ::CurrentConferenceAssigning
before_filter :require_current_conference!
before_action :require_current_conference!
def current_conference
@current_conference ||= Conference.order(created_at: :desc).find_by(host_name: request.host)

View File

@ -1,6 +1,6 @@
module Public
class EventsController < Public::ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def index
@events = Event.joins(:conference, :proposition, :participations).where(conference: current_conference).where('propositions.proposer_id = ? OR participations.participant_id = ?', current_user.id, current_user.id)

View File

@ -1,6 +1,6 @@
module Public
class PersonalProfilesController < Public::ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def create
@profile = current_user.build_personal_profile(current_conference, profile_params)

View File

@ -1,6 +1,6 @@
module Public
class VolunteershipsController < Public::ApplicationController
before_filter :authenticate_user!, only: [:create, :destroy]
before_action :authenticate_user!, only: [:create, :destroy]
def index
@volunteer_teams = current_conference.volunteer_teams