<commit_before>class Question < ActiveRecord::Base
  STATUSES = %w(pending accepted declined)
  attr_accessible :body, :email, :name, :is_anonymous

  has_many :answers

  validates_presence_of :body, :email, :name
  validates_length_of :body, maximum: 140
  validates_inclusion_of :status, in: STATUSES

  before_validation :set_init_defaults

  def self.accepted
    where(status: :accepted)
  end<commit_msg>Add answered scope for question<commit_after>class Question < ActiveRecord::Base
  STATUSES = %w(pending accepted declined)
  attr_accessible :body, :email, :name, :is_anonymous

  has_many :answers

  validates_presence_of :body, :email, :name
  validates_length_of :body, maximum: 140
  validates_inclusion_of :status, in: STATUSES

  before_validation :set_init_defaults

  scope :accepted, -> { where(status: :accepted) }

  scope :answered, -> { joins(:answers) }
{'fraction_non_alphanumeric': 0.09556313993174062, 'fraction_numerical': 0.006825938566552901, 'mean_word_length': 5.616541353383458, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5862859', 'n_tokens_mistral': 308, 'n_tokens_neox': 282, 'n_words': 71}