<commit_before># Represents a question. Questions are attached to a user account, and have many answers, a score, and can be voted on.
class Question < ActiveRecord::Base
  belongs_to :user

  has_many :answers
  has_many :votes, :as => :post

  serialize :tags, Array

  validates :title, :body, :tags, :presence => true
  validates :title, length: { minimum: 15, maximum: 255 }
  validates :body, length: { minimum: 30, maximum: 30000 }
  validate :maximum_tags<commit_msg>annotate question model<commit_after># Represents a question. Questions are attached to a user account, and have many answers, a score, and can be voted on.
class Question < ActiveRecord::Base
  # Attached to a user account.
  belongs_to :user

  # Can be answered.
  has_many :answers

  # Can be voted on as a Post.
  has_many :votes, :as => :post

  # Tags are not a string, they're a group of strings - sounds like an array to me.
  serialize :tags, Array

  # Can't be having questions without titles, bodies, or tags.
  validates :title, :body, :tags, :presence => true

  # It doesn't make sense to have 1-character posts, so let's have some minimums. And maximums, for that matter.
  validates :title, length: { minimum: 15, maximum: 255 }
  validates :body, length: { minimum: 30, maximum: 30000 }

  # Tags are not a string, but that does make validation a little irritating.
  validate :maximum_tags
{'fraction_non_alphanumeric': 0.0888086642599278, 'fraction_numerical': 0.018050541516245487, 'mean_word_length': 3.967741935483871, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4375857', 'n_tokens_mistral': 449, 'n_tokens_neox': 408, 'n_words': 188}