<commit_before>class Admin::ManageUsersController < ApplicationController

  def index
    @manage_users = User.all
  end

  def show
    @manage_user = User.find_by(id: params[:id])
  end

  def edit
    @manage_user = User.find_by(id: params[:id])
  end

  def update
    @manage_user = User.find_by(id: params[:id])

    @manage_user.update_attribute(:role, params[:user][:role])

    redirect_to admin_manage_user_path(@manage_user)
  end


  private
  def user_params
    params.require(:user).permit(:username, :password, :password_confirmation, :role, :email)
  end
end<commit_msg>refactored manage_users controller<commit_after>class Admin::ManageUsersController < ApplicationController
  before_action :set_user
  def index
    @manage_users = User.all
  end

  def show
    @manage_user = User.find_by(id: params[:id])
  end

  def edit
    @manage_user = User.find_by(id: params[:id])
  end

  def update


    @manage_user.update_attribute(:role, params[:user][:role])

    redirect_to admin_manage_user_path(@manage_user)
  end


  private
  def user_params
    params.require(:user).permit(:username, :password, :password_confirmation, :role, :email)
  end

  def set_user
    @manage_user = User.find_by(id: params[:id])
  end
end
{'fraction_non_alphanumeric': 0.10843373493975904, 'fraction_numerical': 0.0, 'mean_word_length': 4.347639484978541, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7479854', 'n_tokens_mistral': 440, 'n_tokens_neox': 408, 'n_words': 86}