<commit_before>class Document
  include ActiveModel::Model
  include ActiveModel::Validations
  include ActionView::Helpers::TextHelper
  include PublishingHelper

  attr_accessor(
    :content_id,
    :base_path,
    :title,
    :summary,
    :body,
    :format_specific_fields,
    :public_updated_at,
    :state,
    :bulk_published,
    :publication_state,
    :state_history,
    :change_history,
    :document_type,
    :attachments,
    :first_published_at,
    :previous_version,
    :temporary_update_type,
    :update_type
  )

  def temporary_update_type?
    @temporary_update_type
  end

  validates :title, presence: true
  validates :summary, presence: true
  validates :body, presence: true, safe_html: true
  validates :update_type, presence: true, unless: :first_draft?
  validates :change_note, presence: true, if: :change_note_required?

  COMMON_FIELDS = [
    :base_path,
    :title,
    :summary,
    :body,
    :publication_state,
    :state_history,
    :public_updated_at,
    :first_published_at,
    :update_type,<commit_msg>Enforced boolean on temporary update type<commit_after>class Document
  include ActiveModel::Model
  include ActiveModel::Validations
  include ActionView::Helpers::TextHelper
  include PublishingHelper

  attr_accessor(
    :content_id,
    :base_path,
    :title,
    :summary,
    :body,
    :format_specific_fields,
    :public_updated_at,
    :state,
    :bulk_published,
    :publication_state,
    :state_history,
    :change_history,
    :document_type,
    :attachments,
    :first_published_at,
    :previous_version,
    :temporary_update_type,
    :update_type
  )

  def temporary_update_type?
    !!@temporary_update_type
  end

  validates :title, presence: true
  validates :summary, presence: true
  validates :body, presence: true, safe_html: true
  validates :update_type, presence: true, unless: :first_draft?
  validates :change_note, presence: true, if: :change_note_required?

  COMMON_FIELDS = [
    :base_path,
    :title,
    :summary,
    :body,
    :publication_state,
    :state_history,
    :public_updated_at,
    :first_published_at,
    :update_type,
{'fraction_non_alphanumeric': 0.0898876404494382, 'fraction_numerical': 0.0, 'mean_word_length': 3.9013761467889907, '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': '7423264', 'n_tokens_mistral': 712, 'n_tokens_neox': 705, 'n_words': 142}