<commit_before># Comment for internal use by admins.
# Allows adding note to any other Model. Displayed in Admin backend.
class Note < ActiveRecord::Base
  # Concerns
  include NoteReferencable # A note can be the target of references

  # Associations
  belongs_to :notable, polymorphic: true # , inverse_of: :notes

  belongs_to :referencable, polymorphic: true, inverse_of: :referencing_notes
  belongs_to :user, inverse_of: :authored_notes # Author

  # Scopes
  scope :not_referencing_note, lambda {
    where(
      'notes.referencable_type IS NULL OR notes.referencable_type != ?', 'Note'
    )
  }

  # Enumerization
  extend Enumerize
  enumerize :topic, in: %w(todo external_info)

  # Validations
  validates :text, presence: true, length: { maximum: 800 }
  validates :topic, presence: true

  validates :notable, presence: true
  validates :user, presence: true

  # Methods

  delegate :name, to: :user, prefix: true
end<commit_msg>Change note topic name<commit_after># Comment for internal use by admins.
# Allows adding note to any other Model. Displayed in Admin backend.
class Note < ActiveRecord::Base
  # Concerns
  include NoteReferencable # A note can be the target of references

  # Associations
  belongs_to :notable, polymorphic: true # , inverse_of: :notes

  belongs_to :referencable, polymorphic: true, inverse_of: :referencing_notes
  belongs_to :user, inverse_of: :authored_notes # Author

  # Scopes
  scope :not_referencing_note, lambda {
    where(
      'notes.referencable_type IS NULL OR notes.referencable_type != ?', 'Note'
    )
  }

  # Enumerization
  extend Enumerize
  enumerize :topic, in: %w(internal_info external_info)

  # Validations
  validates :text, presence: true, length: { maximum: 800 }
  validates :topic, presence: true

  validates :notable, presence: true
  validates :user, presence: true

  # Methods

  delegate :name, to: :user, prefix: true
end
{'fraction_non_alphanumeric': 0.08481675392670157, 'fraction_numerical': 0.0031413612565445027, 'mean_word_length': 4.25, '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': '2083796', 'n_tokens_mistral': 623, 'n_tokens_neox': 598, 'n_words': 196}