Sha256: 34001a7135123974aa2302efbabce1f951e0e22ab8d8403093e6564358c23822

Contents?: true

Size: 809 Bytes

Versions: 3

Compression:

Stored size: 809 Bytes

Contents

# frozen_string_literal: true

class MedPipe::PipelinePlan < MedPipe::ApplicationRecord
  belongs_to :pipeline_group, class_name: "MedPipe::PipelineGroup", optional: true

  scope :active, -> { where(status: %i[enqueued running]) }

  validates :name, presence: true
  validates :output_unit, presence: true
  validates :status, presence: true

  # TODO: Rails6記法のため、Rails8に上げる際に定義の仕方を変える
  # https://zenn.dev/kanazawa/articles/8bc1fcbba3ef1d#enum%E3%81%AE%E5%AE%9A%E7%BE%A9%E6%96%B9%E6%B3%95%E3%81%8C%E5%A4%89%E3%82%8F%E3%82%8B
  enum status: {
    waiting: "waiting",
    enqueued: "enqueued",
    running: "running",
    finished: "finished",
    failed: "failed"
  }, _prefix: true

  enum output_unit: {
    daily: "daily",
    all: "all"
  }, _prefix: true
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
med_pipe-0.1.1 app/models/med_pipe/pipeline_plan.rb
med_pipe-0.1.0.5 app/models/med_pipe/pipeline_plan.rb
med_pipe-0.1.0.4 app/models/med_pipe/pipeline_plan.rb