<commit_before>class RacesController < ApplicationController

  # Show Races for a Category
  # === Params
  # * id: Category ID
  # === Assigns
  # * races
  # * category
  def index
    if params[:event_id]
      @event = Event.includes(:races).find(params[:event_id])
      unless mobile_request?
        redirect_to event_results_path(@event)
      end
    else
      @category = Category.find(params[:category_id])
    end
  end
  
  def show
    @race = Race.find(params[:id])
    unless mobile_request?
      redirect_to event_results_path(@race.event)
    end
  end
end<commit_msg>Guard against mobiel browsers visiting page not intended for mobile<commit_after>class RacesController < ApplicationController

  # Show Races for a Category
  # === Params
  # * id: Category ID
  # === Assigns
  # * races
  # * category
  def index
    if params[:event_id]
      @event = Event.includes(:races).find(params[:event_id])
      unless mobile_request?
        redirect_to event_results_path(@event)
      end
    else
      if mobile_request?
        return redirect_to_full_site
      end
      @category = Category.find(params[:category_id])
    end
  end
  
  def show
    @race = Race.find(params[:id])
    unless mobile_request?
      redirect_to event_results_path(@race.event)
    end
  end
end
{'fraction_non_alphanumeric': 0.09279141104294479, 'fraction_numerical': 0.0, 'mean_word_length': 2.966565349544073, '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': '3085848', 'n_tokens_mistral': 406, 'n_tokens_neox': 398, 'n_words': 97}