<commit_before>class CommitRequestsController < ApplicationController
  respond_to :json

  def new
    @commit_request = CommitRequest.new
  end

  def create
    @commit_request = CommitRequest.new(params[:commit_request].merge({
      repository: params[:repository_id]
    }))
    
    flash[:notice] = "Commit request was created" if @commit_request.valid?
    respond_with(repository, @commit_request)
  end

  private
  def repository
    Repository.find(params[:repository_id])
  end
end<commit_msg>CR has to be decoded<commit_after>class CommitRequestsController < ApplicationController
  respond_to :json

  def new
    @commit_request = CommitRequest.new
  end

  def create
    request = ActiveSupport::JSON.decode(params[:commit_request])
    @commit_request = CommitRequest.new(request.merge({
      repository: params[:repository_id]
    }))
    
    flash[:notice] = "Commit request was created" if @commit_request.valid?
    respond_with(repository, @commit_request)
  end

  private
  def repository
    Repository.find(params[:repository_id])
  end
end
{'fraction_non_alphanumeric': 0.08776844070961717, 'fraction_numerical': 0.0, 'mean_word_length': 4.280788177339901, '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': '665458', 'n_tokens_mistral': 309, 'n_tokens_neox': 301, 'n_words': 69}