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
class AdminController < ApplicationController
before_filter :authenticate_user!
before_filter :redirect_unless_admin
before_action :authenticate_user!
before_action :redirect_unless_admin
end
end

View file

@ -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
end

View file

@ -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?