<commit_before>class DataPoint < ActiveRecord::Base

  belongs_to :aggregator
  belongs_to :topic
  has_and_belongs_to_many :data_collections
  has_and_belongs_to_many :reports

  validates :aggregator_id, presence: true
  validate :all_fields_exist

  def field_array
    @field_arr ||= fields.split(',').map(&:strip)
  end

  private

    def all_fields_exist
      conn = GeographicDatabase.connection
      messages = field_array.map do |field|
        if !conn.column_exists?( "tabular.#{self.tables}", field )
          "field #{field} in table #{self.tables} does not exist"
        end
      end
      puts messages.inspect
      messages.compact.each { |message| errors.add(:fields, message) }
    end

end<commit_msg>Remove message print<commit_after>class DataPoint < ActiveRecord::Base

  belongs_to :aggregator
  belongs_to :topic
  has_and_belongs_to_many :data_collections
  has_and_belongs_to_many :reports

  validates :aggregator_id, presence: true
  validate :all_fields_exist

  def field_array
    @field_arr ||= fields.split(',').map(&:strip)
  end

  private

    def all_fields_exist
      conn = GeographicDatabase.connection
      messages = field_array.map do |field|
        if !conn.column_exists?( "tabular.#{self.tables}", field )
          "field #{field} in table #{self.tables} does not exist"
        end
      end
      messages.compact.each { |message| errors.add(:fields, message) }
    end

end
{'fraction_non_alphanumeric': 0.09560362875087229, 'fraction_numerical': 0.0, 'mean_word_length': 3.48125, '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': '4976693', 'n_tokens_mistral': 458, 'n_tokens_neox': 450, 'n_words': 105}