Replace old ..._filter with new ..._action

This commit is contained in:
Benjamin Neff 2017-08-05 23:03:22 +02:00
parent 6e4c5bae29
commit c382321934
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 6 additions and 8 deletions

View file

@ -1,8 +1,6 @@
module Admin module Admin
class AdminController < ApplicationController class AdminController < ApplicationController
before_action :authenticate_user!
before_filter :authenticate_user! before_action :redirect_unless_admin
before_filter :redirect_unless_admin
end end
end end

View file

@ -1,6 +1,6 @@
class PollParticipationsController < ApplicationController class PollParticipationsController < ApplicationController
include ApplicationHelper include ApplicationHelper
before_filter :authenticate_user! before_action :authenticate_user!
def create def create
answer = PollAnswer.find(params[:poll_answer_id]) answer = PollAnswer.find(params[:poll_answer_id])

View file

@ -3,8 +3,8 @@
# the COPYRIGHT file. # the COPYRIGHT file.
class SessionsController < Devise::SessionsController class SessionsController < Devise::SessionsController
after_filter :reset_authentication_token, :only => [:create] after_action :reset_authentication_token, only: [:create]
before_filter :reset_authentication_token, :only => [:destroy] before_action :reset_authentication_token, only: [:destroy]
def reset_authentication_token def reset_authentication_token
current_user.reset_authentication_token! unless current_user.nil? current_user.reset_authentication_token! unless current_user.nil?