<commit_before>class UsersController < ApplicationController
  before_action :set_user, only: [:update]
  before_action :authorize_access

  def index
    @users = User.search(params[:search])
  end

  def show
    @user = User.find(session[:user_id])
  end

  def edit
    @user = User.find(session[:user_id])
  end

  def update
    respond_to do |format|
      if @user.update(user_params)
        format.html { redirect_to @user, notice: '更新しました。' }
      else
        format.html { render :edit }
      end
    end
  end

  def destroy
    @user = User.find(session[:user_id])
    @user.destroy
    respond_to do |format|
      format.html { redirect_to :root, notice: '退会しました。' }
    end
  end


  private
  # Use callbacks to share common setup or constraints between actions.
  def set_user
    @user = User.find(params[:id])
  end<commit_msg>other users can't show bug fix.<commit_after>class UsersController < ApplicationController
  before_action :set_user, only: [:update]
  before_action :authorize_access

  def index
    @users = User.search(params[:search])
  end

  def show
    @user = User.find_by_nickname(params[:nickname])
  end

  def edit
    @user = User.find(session[:user_id])
  end

  def update
    respond_to do |format|
      if @user.update(user_params)
        format.html { redirect_to @user, notice: '更新しました。' }
      else
        format.html { render :edit }
      end
    end
  end

  def destroy
    @user = User.find(session[:user_id])
    @user.destroy
    respond_to do |format|
      format.html { redirect_to :root, notice: '退会しました。' }
    end
  end


  private
  # Use callbacks to share common setup or constraints between actions.
  def set_user
    @user = User.find(params[:id])
  end
{'fraction_non_alphanumeric': 0.09930715935334873, 'fraction_numerical': 0.0, 'mean_word_length': 2.947608200455581, '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': '3499959', 'n_tokens_mistral': 584, 'n_tokens_neox': 562, 'n_words': 152}