sul-dlss/dor-services-app

View on GitHub
app/models/background_job_result.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

# Database-backed model to hold results of long-running jobs
class BackgroundJobResult < ApplicationRecord
  enum :status, {
    pending: 'pending',
    processing: 'processing',
    complete: 'complete'
  }

  # Deserialize JSON output field as a Hash with indifferent access
  def output
    @output ||= super.with_indifferent_access
  end
end