Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider c3823219 rédigé par Benjamin Neff's avatar Benjamin Neff
Parcourir les fichiers

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

parent 6e4c5bae
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
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
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])
...@@ -25,4 +25,4 @@ class PollParticipationsController < ApplicationController ...@@ -25,4 +25,4 @@ class PollParticipationsController < ApplicationController
current_user.find_visible_shareable_by_id(Post, params[:post_id]) || raise(ActiveRecord::RecordNotFound.new) current_user.find_visible_shareable_by_id(Post, params[:post_id]) || raise(ActiveRecord::RecordNotFound.new)
end end
end end
end end
\ No newline at end of file
...@@ -3,8 +3,8 @@ ...@@ -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?
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter