<commit_before># frozen_string_literal: true

# Gathers and returns status object that determines if the app is healthy and ready.

class StatusService
  def initialize
    freeze
  end

  class << self
    delegate :call, to: :new
  end

  # Status object that handles serialization and acts as an Entity object.
  class Status
    def initialize(**status)
      @status = status.merge(ok: status.values.all?(&:itself)).freeze
      freeze
    end

    delegate :as_json, to: :@status
  end

  def call
    Status.new(database: ActiveRecord::Base.connected?)
  end
end<commit_msg>check pending migrations in status api<commit_after># frozen_string_literal: true

# Gathers and returns status object that determines if the app is healthy and ready.

class StatusService
  def initialize
    freeze
  end

  class << self
    delegate :call, to: :new
  end

  # Status object that handles serialization and acts as an Entity object.
  class Status
    def initialize(**status)
      @status = status.merge(ok: status.values.all?(&:itself)).freeze
      freeze
    end

    delegate :as_json, to: :@status
  end

  def call
    ActiveRecord::Migration.check_pending!

    Status.new(database: ActiveRecord::Base.connected?)
  end
end
{'fraction_non_alphanumeric': 0.07798537774167344, 'fraction_numerical': 0.0, 'mean_word_length': 3.4476534296028882, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1337919', 'n_tokens_mistral': 358, 'n_tokens_neox': 354, 'n_words': 127}