<commit_before>module MatchSeeder
  module Common
    extend self

    def get_roster_pool(target)
      rosters = target.approved_rosters
      rosters << nil if rosters.size.odd?
      rosters.to_a
    end

    def create_match_for(home_team, away_team, options)
      # Swap home and away team to spread out home/away matches
      if home_team && away_team &&
         (home_team.home_team_matches.size > home_team.away_team_matches.size ||
          away_team.away_team_matches.size > away_team.home_team_matches.size) ||
         !home_team
        home_team, away_team = away_team, home_team
      end

      match_options = options.merge(home_team: home_team, away_team: away_team)
      match_options[:sets] = match_options[:sets].map(&:dup)
      CompetitionMatch.create!(match_options)
    end
  end
end
<commit_msg>Fixed MatchSeeder::Common#create_match_for not respecting local options<commit_after>module MatchSeeder
  module Common
    extend self

    def get_roster_pool(target)
      rosters = target.approved_rosters
      rosters << nil if rosters.size.odd?
      rosters.to_a
    end

    def create_match_for(home_team, away_team, options)
      # Swap home and away team to spread out home/away matches
      if home_team && away_team &&
         (home_team.home_team_matches.size > home_team.away_team_matches.size ||
          away_team.away_team_matches.size > away_team.home_team_matches.size) ||
         !home_team
        home_team, away_team = away_team, home_team
      end

      match_options = options.merge(home_team: home_team, away_team: away_team)
      match_options[:sets] = match_options[:sets].map(&:dup) if match_options.has_key? :sets
      CompetitionMatch.create!(match_options)
    end
  end
end

{'fraction_non_alphanumeric': 0.07912844036697247, 'fraction_numerical': 0.0, 'mean_word_length': 3.2769607843137254, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6688208', 'n_tokens_mistral': 558, 'n_tokens_neox': 548, 'n_words': 116}