<commit_before>class DocumentUpload
  include Virtus.model
  extend ActiveModel::Naming
  extend ActiveModel::Translation

  attribute :tempfile, Object
  attribute :content_type, String
  attribute :original_filename, String
  attribute :collection_ref, String
  attribute :document_key, String

  attr_accessor :errors

  # TODO: decide on the final allowed max size and content types
  #
  MAX_FILE_SIZE = 20 # MB
  ALLOWED_CONTENT_TYPES = %w(
    application/pdf
    application/msword
    application/vnd.ms-excel
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    application/vnd.oasis.opendocument.text
    application/rtf
    text/plain
    text/rtf
    text/csv
    image/gif
    image/jpeg<commit_msg>Fix an issue where IE8 won't upload a JPG (#515)<commit_after>class DocumentUpload
  include Virtus.model
  extend ActiveModel::Naming
  extend ActiveModel::Translation

  attribute :tempfile, Object
  attribute :content_type, String
  attribute :original_filename, String
  attribute :collection_ref, String
  attribute :document_key, String

  attr_accessor :errors

  # TODO: decide on the final allowed max size and content types
  #
  MAX_FILE_SIZE = 20 # MB
  ALLOWED_CONTENT_TYPES = %w(
    application/pdf
    application/msword
    application/vnd.ms-excel
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    application/vnd.oasis.opendocument.text
    application/rtf
    text/plain
    text/rtf
    text/csv
    image/gif
    image/jpeg
    image/pjpeg
{'fraction_non_alphanumeric': 0.06523040095751047, 'fraction_numerical': 0.0047875523638539795, 'mean_word_length': 3.9761904761904763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4095373', 'n_tokens_mistral': 522, 'n_tokens_neox': 493, 'n_words': 115}