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 class Api::EventTypesController < Api::ApplicationController
include ::CurrentConferenceAssigning include ::CurrentConferenceAssigning
include ::PublicApiExposing include ::PublicApiExposing
before_filter :require_current_conference! before_action :require_current_conference!
def index def index
@event_types = current_conference.event_types.includes(:translations) @event_types = current_conference.event_types.includes(:translations)

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception. # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead. # For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception 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_locale
before_action :set_view_paths before_action :set_view_paths

View File

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

View File

@ -1,6 +1,6 @@
module Public module Public
class EventsController < Public::ApplicationController class EventsController < Public::ApplicationController
before_filter :authenticate_user! before_action :authenticate_user!
def index 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) @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 module Public
class PersonalProfilesController < Public::ApplicationController class PersonalProfilesController < Public::ApplicationController
before_filter :authenticate_user! before_action :authenticate_user!
def create def create
@profile = current_user.build_personal_profile(current_conference, profile_params) @profile = current_user.build_personal_profile(current_conference, profile_params)

View File

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