<commit_before># = Informations
#
# == License
#
# Ekylibre - Simple ERP
# Copyright (C) 2009-2013 <NAME>, <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see http://www.gnu.org/licenses.
#
# == Table: documents
#
#  archived_at       :datetime
#  created_at        :datetime         not null
#  creator_id        :integer
#  file_content_type :string(255)
#  file_file_name    :string(255)
#  file_file_size    :integer
#  file_fingerprint  :string(255)
#  file_updated_at   :datetime
#  id                :integer          not null, primary key
#  lock_version      :integer          default(0), not null
#  name              :string(255)      not null
#  nature            :string(63)       not null
#  origin_id         :integer
#  origin_type       :string(255)
#  template_id       :integer
#  updated_at        :datetime         not null
#  updater_id        :integer
#

class Document < Ekylibre::Record::Base
  belongs_to :origin, :polymorphic => true
  belongs_to :template, :class_name => "DocumentTemplate"
  has_attached_file :file
  #[VALIDATORS[ Do not edit these lines directly. Use `rake clean:validations`.
  validates_numericality_of :file_file_size, :allow_nil => true, :only_integer => true
  validates_length_of :nature, :allow_nil => true, :maximum => 63<commit_msg>Adds enumerize on document#nature<commit_after># = Informations
#
# == License
#
# Ekylibre - Simple ERP
# Copyright (C) 2009-2013 <NAME>, <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see http://www.gnu.org/licenses.
#
# == Table: documents
#
#  archived_at       :datetime
#  created_at        :datetime         not null
#  creator_id        :integer
#  file_content_type :string(255)
#  file_file_name    :string(255)
#  file_file_size    :integer
#  file_fingerprint  :string(255)
#  file_updated_at   :datetime
#  id                :integer          not null, primary key
#  lock_version      :integer          default(0), not null
#  name              :string(255)      not null
#  nature            :string(63)       not null
#  origin_id         :integer
#  origin_type       :string(255)
#  template_id       :integer
#  updated_at        :datetime         not null
#  updater_id        :integer
#

class Document < Ekylibre::Record::Base
  belongs_to :origin, :polymorphic => true
  belongs_to :template, :class_name => "DocumentTemplate"
  enumerize :nature, :in => Nomenclature::DocumentClassification.document_natures.map(&:name), :predicates => {:prefix => true}
  has_attached_file :file
  #[VALIDATORS[ Do not edit these lines directly. Use `rake clean:validations`.
  validates_numericality_of :file_file_size, :allow_nil => true, :only_integer => true
  validates_length_of :nature, :allow_nil => true, :maximum => 63
{'fraction_non_alphanumeric': 0.08635170603674541, 'fraction_numerical': 0.015223097112860892, 'mean_word_length': 3.2344444444444442, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5072606', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1114, 'n_words': 395}