<commit_before>class Tag

include Mongoid::Document

  self.collection_name = 'tags'

  belongs_to :user

  field :link, type: String
  field :title, type: String
  field :entitytype, type: String
  field :entityid, type: Integer
  field :tag, type: String

  def to_param
    tag
  end
end<commit_msg>Enforce the length of tag attribute to not longer than 30 characters<commit_after>class Tag

include Mongoid::Document

  self.collection_name = 'tags'

  belongs_to :user

  field :link, type: String
  field :title, type: String
  field :entitytype, type: String
  field :entityid, type: Integer
  field :tag, type: String

  validates_length_of :tag, maximum: 30
  
  def to_param
    tag
  end
end
{'fraction_non_alphanumeric': 0.0754985754985755, 'fraction_numerical': 0.005698005698005698, 'mean_word_length': 3.9160839160839163, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1827053', 'n_tokens_mistral': 233, 'n_tokens_neox': 222, 'n_words': 80}