<commit_before>class OgcSupplier < ActiveRecord::Base

  belongs_to :company

  validates_presence_of :name
  validates_presence_of :ogc_id

  validates_uniqueness_of :name
  validates_uniqueness_of :ogc_id

  before_validation :set_company_id

  def find_company_data
    CompaniesHouse.search_by_name(name)
  end

  private
    def set_company_id
      unless company_id
        companies = Company.retrieve_by_name(self.name)
        if companies.size == 1
          self.company_id = companies.first.id
        end
      end
    end
end<commit_msg>match by xml gateway results<commit_after>class OgcSupplier < ActiveRecord::Base

  belongs_to :company

  validates_presence_of :name
  validates_presence_of :ogc_id

  validates_uniqueness_of :name
  validates_uniqueness_of :ogc_id

  before_validation :set_company_id

  def find_company_data
    CompaniesHouse.search_by_name(name)
  end

    def set_company_id
      unless company_id
        companies = Company.retrieve_by_name(self.name)
        if companies.size == 1
          self.company_id = companies.first.id
        end
      end
    end
end
{'fraction_non_alphanumeric': 0.04869251577998197, 'fraction_numerical': 0.0018034265103697023, 'mean_word_length': 3.3359375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '7628239', 'n_tokens_mistral': 375, 'n_tokens_neox': 363, 'n_words': 72}