<commit_before>class Category < ApplicationRecord
  validates :name, :color, :requested_by, presence: true
  validates :color, uniqueness: { case_sensitive: false }

  belongs_to :requested_by, class_name: 'User'
  belongs_to :approved_by, class_name: 'User', optional: true

  scope :approved, -> { where(approved: true) }

  def as_json(options = {})
    super(options.merge(only: [:id, :name, :color]))<commit_msg>Add approved to category json<commit_after>class Category < ApplicationRecord
  validates :name, :color, :requested_by, presence: true
  validates :color, uniqueness: { case_sensitive: false }

  belongs_to :requested_by, class_name: 'User'
  belongs_to :approved_by, class_name: 'User', optional: true

  scope :approved, -> { where(approved: true) }

  def as_json(options = {})
    super(options.merge(only: [:id, :name, :color, :approved]))
{'fraction_non_alphanumeric': 0.13240418118466898, 'fraction_numerical': 0.0, 'mean_word_length': 5.630769230769231, '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': '3356394', 'n_tokens_mistral': 287, 'n_tokens_neox': 275, 'n_words': 72}