From c38232193435711e7df919bc96e51ef10aceda8b Mon Sep 17 00:00:00 2001 From: Benjamin Neff <benjamin@coding4coffee.ch> Date: Sat, 5 Aug 2017 23:03:22 +0200 Subject: [PATCH] Replace old `..._filter` with new `..._action` --- app/controllers/admin/admin_controller.rb | 6 ++---- app/controllers/poll_participations_controller.rb | 4 ++-- app/controllers/sessions_controller.rb | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/controllers/admin/admin_controller.rb b/app/controllers/admin/admin_controller.rb index 8e22795ef2..24f08cdf02 100644 --- a/app/controllers/admin/admin_controller.rb +++ b/app/controllers/admin/admin_controller.rb @@ -1,8 +1,6 @@ module Admin class AdminController < ApplicationController - - before_filter :authenticate_user! - before_filter :redirect_unless_admin - + before_action :authenticate_user! + before_action :redirect_unless_admin end end diff --git a/app/controllers/poll_participations_controller.rb b/app/controllers/poll_participations_controller.rb index 2fd07c76ea..205f9c2b3b 100644 --- a/app/controllers/poll_participations_controller.rb +++ b/app/controllers/poll_participations_controller.rb @@ -1,6 +1,6 @@ class PollParticipationsController < ApplicationController include ApplicationHelper - before_filter :authenticate_user! + before_action :authenticate_user! def create answer = PollAnswer.find(params[:poll_answer_id]) @@ -25,4 +25,4 @@ class PollParticipationsController < ApplicationController current_user.find_visible_shareable_by_id(Post, params[:post_id]) || raise(ActiveRecord::RecordNotFound.new) end end -end \ No newline at end of file +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 61f4642090..74fd1f8187 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -3,8 +3,8 @@ # the COPYRIGHT file. class SessionsController < Devise::SessionsController - after_filter :reset_authentication_token, :only => [:create] - before_filter :reset_authentication_token, :only => [:destroy] + after_action :reset_authentication_token, only: [:create] + before_action :reset_authentication_token, only: [:destroy] def reset_authentication_token current_user.reset_authentication_token! unless current_user.nil? -- GitLab