<commit_before>class ImageFile < ActiveRecord::Base

  include FileStorage

  attr_accessible :file, :original_file_url, :storage_id, :is_uploaded, :remote_file_url, :imageable_id, :imageable_type
  belongs_to :imageable, :polymorphic => true
  belongs_to :storage_configuration, class_name: "StorageConfiguration", foreign_key: :storage_id

  mount_uploader :file, ImageUploader

  after_commit :process_file, on: :create
  after_commit :process_update_file, on: :update

  def process_update_file
    # logger.debug "af #{id} call copy_to_item_storage"
    copy_to_item_storage
  end<commit_msg>Added a belongs_to relationship for the items and collections<commit_after>class ImageFile < ActiveRecord::Base

  include FileStorage

  attr_accessible :file, :original_file_url, :storage_id, :is_uploaded, :remote_file_url, :imageable_id, :imageable_type
  belongs_to :imageable, :polymorphic => true
  belongs_to :item,         :class_name => 'Item',
                                      :foreign_key => 'imageable_id'
  belongs_to :collection, :class_name => 'Collection',
                                      :foreign_key => 'collection_id'
  belongs_to :storage_configuration, class_name: "StorageConfiguration", foreign_key: :storage_id

  mount_uploader :file, ImageUploader

  after_commit :process_file, on: :create
  after_commit :process_update_file, on: :update

  def process_update_file
    # logger.debug "af #{id} call copy_to_item_storage"
    copy_to_item_storage
  end
{'fraction_non_alphanumeric': 0.08338937457969066, 'fraction_numerical': 0.0, 'mean_word_length': 4.573033707865169, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2452571', 'n_tokens_mistral': 465, 'n_tokens_neox': 452, 'n_words': 105}