<commit_before>require 'open-uri'

class Matchup < ActiveRecord::Base
	belongs_to :season
	has_many :team_matchups
	has_many :teams, through: :team_matchups


	def extract_results
		teams = remote_team_ids.map { |remote_id| Team.find_by remote_id: remote_id, season: season }

		teams.each { |team| self.teams << team }

		self.save

		scoring_period = source_path.match(/scoringPeriodId=(\d*)/)[1].to_i

		weekly_team_results = teams.map do |team|
			TeamResult.create interval: "weekly",
										 		year: season.year,
	 										  week: find_week_by_scoring_period(scoring_period),
											  scoring_period: scoring_period,
									  		points: team_points(team.remote_id, scoring_period),
									  		team: team,
									  		matchup: self
		end
<commit_msg>Fix typo in matchup associations<commit_after>require 'open-uri'

class Matchup < ActiveRecord::Base
	belongs_to :season
	has_many :team_results
	has_many :teams, through: :team_results


	def extract_results
		teams = remote_team_ids.map { |remote_id| Team.find_by remote_id: remote_id, season: season }

		teams.each { |team| self.teams << team }

		self.save

		scoring_period = source_path.match(/scoringPeriodId=(\d*)/)[1].to_i

		weekly_team_results = teams.map do |team|
			TeamResult.create interval: "weekly",
										 		year: season.year,
	 										  week: find_week_by_scoring_period(scoring_period),
											  scoring_period: scoring_period,
									  		points: team_points(team.remote_id, scoring_period),
									  		team: team,
									  		matchup: self
		end

{'fraction_non_alphanumeric': 0.09658725048293625, 'fraction_numerical': 0.00128783000643915, 'mean_word_length': 3.2575342465753425, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4853206', 'n_tokens_mistral': 667, 'n_tokens_neox': 524, 'n_words': 106}