]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_roles_controller.rb
Merge remote-tracking branch 'upstream/pull/5126'
[rails.git] / app / controllers / user_roles_controller.rb
index cf5b4de9e35e2c8771673e4bd09ac7d011aeeb73..469b2c40b626845191e7a5265e873c340da7c4f4 100644 (file)
@@ -1,4 +1,6 @@
 class UserRolesController < ApplicationController
 class UserRolesController < ApplicationController
+  include UserMethods
+
   layout "site"
 
   before_action :authorize_web
   layout "site"
 
   before_action :authorize_web
@@ -20,7 +22,7 @@ class UserRolesController < ApplicationController
     if current_user == @user && @role == "administrator"
       flash[:error] = t("user_role.filter.not_revoke_admin_current_user")
     else
     if current_user == @user && @role == "administrator"
       flash[:error] = t("user_role.filter.not_revoke_admin_current_user")
     else
-      UserRole.where(:user_id => @user.id, :role => @role).delete_all
+      UserRole.where(:user => @user, :role => @role).delete_all
     end
     redirect_to user_path(@user)
   end
     end
     redirect_to user_path(@user)
   end