<commit_before>class Api::V1::FightController < ApplicationController
  def show
    # Supposedly Rails sanitizes 'find_by_blah'? Consider me skeptical
    fight = Fight.find_by_id(params[:id])

    render json: fight
  end

  def compare_by_name
    champ_one = Champion.find_by_name(params[:champ_one].downcase)
    champ_two = Champion.find_by_name(params[:champ_two].downcase)

    render_fight(champ_one, champ_two)
  end

  def compare_by_id
    champ_one = Champion.find_by_id(params[:champ_one])
    champ_two = Champion.find_by_id(params[:champ_two])
    render_fight(champ_one, champ_two)
  end

  private
  def render_fight(champ_one,champ_two)
    render :json => { left: champ_one, right: champ_two }
  end
end<commit_msg>Dev on production, why not<commit_after>class Api::V1::FightController < ApplicationController
  def show
    # Supposedly Rails sanitizes 'find_by_blah'? Consider me skeptical
    fight = Fight.find_by_id(params[:id])

    render json: fight
  end

  def compare_by_name
    champ_one = Champion.find_by_name(params[:champ_one].downcase)
    champ_two = Champion.find_by_name(params[:champ_two].downcase)

    render_fight(champ_one, champ_two)
  end

  def compare_by_id
    champ_one = Champion.find_by_id(params[:champ_one])
    champ_two = Champion.find_by_id(params[:champ_two])
    render_fight(champ_one, champ_two)
  end

  private
  def render_fight(champ_one,champ_two)
    rematch_check = Fight.where(:blue_champion_id => champ_one.id, :red_champion_id => champ_two.id )
    rematch_check_two = Fight.where(:red_champion_id => champ_one.id, :blue_champion_id => champ_two.id)
    if rematch_check || rematch_check_two
      print("hello world")
    end
    render :json => { left: champ_one, right: champ_two }
  end
end
{'fraction_non_alphanumeric': 0.09451046972269384, 'fraction_numerical': 0.0011318619128466328, 'mean_word_length': 4.7216828478964405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5205263', 'n_tokens_mistral': 644, 'n_tokens_neox': 631, 'n_words': 113}