consul/consul

View on GitHub
app/models/machine_learning_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class MachineLearningJob < ApplicationRecord
  belongs_to :user, optional: false

  def started?
    started_at.present?
  end

  def finished?
    finished_at.present?
  end

  def errored?
    error.present?
  end

  def running_for_too_long?
    started? && !finished? && started_at < 1.day.ago
  end
end