<commit_before>module Admin::RacesHelper
  def link_to_events(race)
    html = ""

    race.event.ancestors.reverse.each do |e|
      html << link_to(truncate(e.name, :length => 40), edit_admin_event_path(e), :class => "obvious")
      html << ": "
    end

    html << link_to(truncate(race.event.name, :length => 40), edit_admin_event_path(race.event), :class => "obvious")
    html << ": "

    html
  end
end<commit_msg>Add helper method for race categories<commit_after>module Admin::RacesHelper
  def link_to_events(race)
    html = ""

    race.event.ancestors.reverse.each do |e|
      html << link_to(truncate(e.name, :length => 40), edit_admin_event_path(e), :class => "obvious")
      html << ": "
    end

    html << link_to(truncate(race.event.name, :length => 40), edit_admin_event_path(race.event), :class => "obvious")
    html << ": "

    html
  end
  
  # BAR category or Rider Rankings category
  def competition_category_name(race)
    if race && race.category
      if race.category.parent
        return race.category.parent.name
      else
        return race.category.name
      end
    end
    ""
  end
end
{'fraction_non_alphanumeric': 0.13327449249779347, 'fraction_numerical': 0.00706090026478376, 'mean_word_length': 3.0938628158844765, 'pattern_counts': {'":': 4, '<': 19, '<?xml version=': 0, '>': 11, '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': '1763977', 'n_tokens_mistral': 401, 'n_tokens_neox': 374, 'n_words': 81}