<commit_before># == Schema Information
#
# Table name: trade_shipments
#
#  id                            :integer          not null, primary key
#  source_id                     :integer
#  unit_id                       :integer
#  purpose_id                    :integer
#  term_id                       :integer          not null
#  quantity                      :decimal(, )      not null
#  appendix                      :string(255)      not null
#  trade_annual_report_upload_id :integer
#  exporter_id                   :integer          not null
#  importer_id                   :integer          not null
#  country_of_origin_id          :integer
#  reported_by_exporter          :boolean          default(TRUE), not null
#  taxon_concept_id              :integer          not null
#  year                          :integer          not null
#  created_at                    :datetime         not null
#  updated_at                    :datetime         not null
#  sandbox_id                    :integer
#  reported_taxon_concept_id     :integer
#

class Trade::Shipment < ActiveRecord::Base
  include PgArrayParser
  attr_accessible :annual_report_upload_id, :appendix,
    :country_of_origin_id, :origin_permit_id,
    :exporter_id, :import_permit_id, :importer_id, :purpose_id,
    :quantity, :reporter_type,
    :source_id, :taxon_concept_id,
    :term_id, :unit_id, :year,
    :import_permit_number, :export_permit_number, :origin_permit_number,
    :ignore_warnings
  attr_accessor :reporter_type, :warnings, :ignore_warnings

  validates :quantity, presence: true, :numericality => {
    :greater_than_or_equal_to => 0, :message => 'should be a positive number'
  }
  validates :appendix, presence: true, :inclusion => {
    :in => ['I', 'II', 'III', 'N'], :message => 'should be one of I, II, III, N'
  }
  validates :year, presence: true, :numericality => {
    :only_integer => true, :greater_than_or_equal_to => 1975, :less_than => 3000,
    :message => 'should be a 4 digit year'
  }
  validates :taxon_concept_id, presence: true
  validates :term_id, presence: true
  validates :exporter_id, presence: true
  validates :importer_id, presence: true
  validates :reporter_type, presence: true, :inclusion => {<commit_msg>use old school ruby hash notation<commit_after># == Schema Information
#
# Table name: trade_shipments
#
#  id                            :integer          not null, primary key
#  source_id                     :integer
#  unit_id                       :integer
#  purpose_id                    :integer
#  term_id                       :integer          not null
#  quantity                      :decimal(, )      not null
#  appendix                      :string(255)      not null
#  trade_annual_report_upload_id :integer
#  exporter_id                   :integer          not null
#  importer_id                   :integer          not null
#  country_of_origin_id          :integer
#  reported_by_exporter          :boolean          default(TRUE), not null
#  taxon_concept_id              :integer          not null
#  year                          :integer          not null
#  created_at                    :datetime         not null
#  updated_at                    :datetime         not null
#  sandbox_id                    :integer
#  reported_taxon_concept_id     :integer
#

class Trade::Shipment < ActiveRecord::Base
  include PgArrayParser
  attr_accessible :annual_report_upload_id, :appendix,
    :country_of_origin_id, :origin_permit_id,
    :exporter_id, :import_permit_id, :importer_id, :purpose_id,
    :quantity, :reporter_type,
    :source_id, :taxon_concept_id,
    :term_id, :unit_id, :year,
    :import_permit_number, :export_permit_number, :origin_permit_number,
    :ignore_warnings
  attr_accessor :reporter_type, :warnings, :ignore_warnings

  validates :quantity, :presence => true, :numericality => {
    :greater_than_or_equal_to => 0, :message => 'should be a positive number'
  }
  validates :appendix, :presence => true, :inclusion => {
    :in => ['I', 'II', 'III', 'N'], :message => 'should be one of I, II, III, N'
  }
  validates :year, :presence => true, :numericality => {
    :only_integer => true, :greater_than_or_equal_to => 1975, :less_than => 3000,
    :message => 'should be a 4 digit year'
  }
  validates :taxon_concept_id, :presence => true
  validates :term_id, :presence => true
  validates :exporter_id, :presence => true
  validates :importer_id, :presence => true
  validates :reporter_type, :presence => true, :inclusion => {
{'fraction_non_alphanumeric': 0.09235528060097216, 'fraction_numerical': 0.0057445868316394165, 'mean_word_length': 2.2197724039829305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '637377', 'n_tokens_mistral': 1423, 'n_tokens_neox': 1349, 'n_words': 339}