<commit_before>class ResultsController < ApplicationController
  def create
    render :ok, json: results
  end

  def results
    result_set.map do |result|
      queries = create_queries(result[:queries])
      Result.create!(result.merge(queries: queries))
    end
  end

  def create_queries(result_queries)
    result_queries.each do |result_query|
      Query.create!(statement: result_query)
    end
  end

  def result_set
    params["result_set"]
  end
end<commit_msg>Things<commit_after>class ResultsController < ApplicationController
  skip_before_action :verify_authenticity_token, only: [:create]

  def create
    render :ok, json: results
  end

  private

  def results
    result_data.map do |result|
      queries = create_queries(result['queries'])
      Result.create!(result.merge(queries: queries))
    end
  end

  def create_queries(result_queries)
    result_queries.each do |result_query|
      Query.create!(statement: result_query)
    end
  end

  def result_data
    params["result_data"]
  end
end
{'fraction_non_alphanumeric': 0.08073929961089495, 'fraction_numerical': 0.0, 'mean_word_length': 3.763888888888889, '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': '3382648', 'n_tokens_mistral': 323, 'n_tokens_neox': 314, 'n_words': 74}