<commit_before>class Pregunta < ApplicationRecord
  enum tipo: { 'radio' => 1,
            'checkbox' => 2,
            'fecha' => 3,
            'email' => 4,
            'selectbox' => 5 }

  has_many :opciones
end<commit_msg>Add default_scope. Define type? methods.<commit_after>class Pregunta < ApplicationRecord
  enum tipo: { 'radio' => 1,
            'checkbox' => 2,
            'fecha' => 3,
            'email' => 4,
            'selectbox' => 5 }

  has_many :opciones

  default_scope -> { includes(:opciones) }

  def opcion_simple?
    ['radio', 'selectbox'].include? tipo
  end

  def opcion_multiple?
    tipo == 'checkbox'
  end

  def texto?
    tipo == 'email'
  end

  def fecha?
    tipo == 'fecha'
  end
end
{'fraction_non_alphanumeric': 0.13580246913580246, 'fraction_numerical': 0.013717421124828532, 'mean_word_length': 2.133047210300429, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '5793664', 'n_tokens_mistral': 262, 'n_tokens_neox': 245, 'n_words': 62}