<commit_before>class UsersController < ApplicationController
	load_resource :group, :only => [:index]
	before_filter :authenticate_user!

	def index
	end

	def edit
		@user = current_user
	end

	def update_avatar
		@user = current_user
		if @user.update(user_params)
			redirect_to root_path
		else
			render "edit"
		end
	 end

	def password
		@user = current_user
	end

	def update_password
		@user = current_user
		if @user.update(user_params)
			# Sign in the user by passing validation in case his password changed
			sign_in @user, :bypass => true
			redirect_to root_path
		else
			render "edit"
		end
	end

	def show
		@user = User.find(params[:id])
	end

	def user_params
		params.required(:user).permit(:password, :password_confirmation, :avatar)
	end
end
<commit_msg>Fix redirecting to user edit view when a user's avatar updated refs #4<commit_after>class UsersController < ApplicationController
	load_resource :group, :only => [:index]
	before_filter :authenticate_user!
	# layout "devise"
	
	def index
	end

	def edit
		@user = current_user
	end

	def update_avatar
		@user = current_user
		@user.update(user_params)
		redirect_to edit_user_registration_path(id:@user.id)
	 end

	def password
		@user = current_user
	end

	def update_password
		@user = current_user
		if @user.update(user_params)
			# Sign in the user by passing validation in case his password changed
			sign_in @user, :bypass => true
			redirect_to root_path
		else
			render "edit"
		end
	end

	def show
		@user = User.find(params[:id])
	end

	def user_params
		params.required(:user).permit(:password, :password_confirmation, :avatar)
	end
end

{'fraction_non_alphanumeric': 0.0785276073619632, 'fraction_numerical': 0.0006134969325153375, 'mean_word_length': 4.128930817610063, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4133413', 'n_tokens_mistral': 605, 'n_tokens_neox': 539, 'n_words': 161}