<commit_before>class RivalsController < ApplicationController

	def create
		authorize :rival_victim
		@rival_victim = RivalVictim.new(victim_id: rivals_params[:victim_id], rival_id: current_user.id)
		if @rival_victim.save
			redirect_to previous_path_or_root
		else
			convert_model_errors_to_flash_error(@rival_victim)
			redirect_to previous_path_or_root
		end
	end

	def destroy
		@rival_victim = RivalVictim.find_by(rivals_params)
		authorize @rival_victim
		@rival_victim.destroy
		redirect_to previous_path_or_root
	end

	def rivals_params
		params.permit(:victim_id, :rival_id)
	end

end<commit_msg>made rival_params private<commit_after>class RivalsController < ApplicationController

	def create
		authorize :rival_victim
		@rival_victim = RivalVictim.new(victim_id: rivals_params[:victim_id], rival_id: current_user.id)
		if @rival_victim.save
			redirect_to previous_path_or_root
		else
			convert_model_errors_to_flash_error(@rival_victim)
			redirect_to previous_path_or_root
		end
	end

	def destroy
		@rival_victim = RivalVictim.find_by(rivals_params)
		authorize @rival_victim
		@rival_victim.destroy
		redirect_to previous_path_or_root
	end

private

	def rivals_params
		params.permit(:victim_id, :rival_id)
	end

end
{'fraction_non_alphanumeric': 0.0582053354890865, 'fraction_numerical': 0.0, 'mean_word_length': 6.074285714285714, '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': '5611588', 'n_tokens_mistral': 524, 'n_tokens_neox': 445, 'n_words': 78}