<commit_before># frozen_string_literal: true

class Import < ApplicationRecord
  self.inheritance_column = false

  enum type: [:following, :blocking, :muting]

  belongs_to :account

  FILE_TYPES = ['text/plain', 'text/csv'].freeze

  has_attached_file :data, url: '/system/:hash.:extension', hash_secret: ENV['PAPERCLIP_SECRET']
  validates_attachment_content_type :data, content_type: FILE_TYPES
end
<commit_msg>Add presence validation to Import<commit_after># frozen_string_literal: true

class Import < ApplicationRecord
  FILE_TYPES = ['text/plain', 'text/csv'].freeze

  self.inheritance_column = false

  belongs_to :account, required: true

  enum type: [:following, :blocking, :muting]

  validates :type, presence: true

  has_attached_file :data, url: '/system/:hash.:extension', hash_secret: ENV['PAPERCLIP_SECRET']
  validates_attachment_content_type :data, content_type: FILE_TYPES
end

{'fraction_non_alphanumeric': 0.10987791342952276, 'fraction_numerical': 0.0, 'mean_word_length': 6.158730158730159, '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': '1416256', 'n_tokens_mistral': 304, 'n_tokens_neox': 298, 'n_words': 68}