<commit_before>class Report < ActivePresenter::Base
  
  presents :project, :error, :occurence
  
  before_validation :find_project
  before_validation :find_error
  
  before_validation :link_error_to_project
  before_validation :link_occurence_to_error
  
  private
  
  def find_project
    pro = Project.find_by_api_token(@project.api_token)
    @project = pro if pro
  end
  
  def find_error
    if err = @project.reports.find_by_hash_string(@error.hash_string)
      @error = err
    end
  end
  
  def link_error_to_project
    @error.project = @project
  end
  
  def link_occurence_to_error
    @occurence.error = @error
  end
  
end<commit_msg>That looks better<commit_after>class Report < ActivePresenter::Base
  
  presents :project, :error, :occurence
  
  before_validation :find_project
  before_validation :find_error
  
  before_validation :link_error_to_project
  before_validation :link_occurence_to_error
  
  private
  
  def find_project
    pro = Project.find_by_api_token(@project.api_token)
    @project = pro if pro
  end
  
  def find_error
    err = @project.reports.find_by_hash_string(@error.hash_string)
    @error = err if err
  end
  
  def link_error_to_project
    @error.project = @project
  end
  
  def link_occurence_to_error
    @occurence.error = @error
  end
  
end
{'fraction_non_alphanumeric': 0.06269113149847094, 'fraction_numerical': 0.0, 'mean_word_length': 3.625441696113074, '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': '1028921', 'n_tokens_mistral': 453, 'n_tokens_neox': 452, 'n_words': 91}