From 479c159f7898d018b6bdd39be128d4c32fb5cbb9 Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Sun, 21 May 2023 16:51:21 +0200 Subject: [PATCH] Disallow status change for self --- app/controllers/users_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b1deef4..503ce07 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,6 +17,7 @@ class UsersController < ApplicationController end def update + raise ArgumentError if current_user == @user @user.update!(params.require(:user).permit(:status)) end