<commit_before># versions are managed by the paper_trail gem... providing a history of
# instance-deltas
module ImportableAttachments
  class Version < ActiveRecord::Base
    attr_accessible :event, :item_id, :item_type, :object, :whodunit

    include SmarterDates if ::Configuration.for('smarter_dates').enabled
    include Rails::MarkRequirements if ::Configuration.for('mark_requirements').enabled

    belongs_to :item, polymorphic: true

    # NOTE: to save nested-model forms, new instances must be valid. Therefore,
    #       attachable_id = nil must be valid when attachable is != nil
    validates :item_id, if: :item_id?, numericality: {only_integer: true, greater_than: 0}

    validates :item_type, alpha_numeric: {punctuation: true}, if: :item_type?

    if ::Configuration.for('versioning').validate_item_type_constants
      validate :valid_item_type?, if: :item_type?
<commit_msg>spell 'whodunnit' correctly<commit_after># versions are managed by the paper_trail gem... providing a history of
# instance-deltas
module ImportableAttachments
  class Version < ActiveRecord::Base
    attr_accessible :event, :item_id, :item_type, :object, :whodunnit

    include SmarterDates if ::Configuration.for('smarter_dates').enabled
    include Rails::MarkRequirements if ::Configuration.for('mark_requirements').enabled

    belongs_to :item, polymorphic: true

    # NOTE: to save nested-model forms, new instances must be valid. Therefore,
    #       attachable_id = nil must be valid when attachable is != nil
    #validates :item_id, if: :item_id?, numericality: {only_integer: true, greater_than: 0}
    validates :item_id, alpha_numeric: {punctuation: true}, if: :item_id?

    validates :item_type, alpha_numeric: {punctuation: true}, if: :item_type?

    if ::Configuration.for('versioning').validate_item_type_constants
      validate :valid_item_type?, if: :item_type?

{'fraction_non_alphanumeric': 0.10010593220338983, 'fraction_numerical': 0.001059322033898305, 'mean_word_length': 4.977848101265823, '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': '2001853', 'n_tokens_mistral': 573, 'n_tokens_neox': 553, 'n_words': 165}