Sha256: bd9afd38eac819c69c0c9e9d74e5080942cbf87619af2c8ed3d64ec1bda3d502

Contents?: true

Size: 878 Bytes

Versions: 14

Compression:

Stored size: 878 Bytes

Contents

module Sipity
  # A named workflow for processing an entity. Originally I had thought of
  # calling this a Type, but once I extracted the Processing submodule,
  # type felt to much of a noun, not conveying potentiality. Workflow
  # conveys "things will happen" because of this.
  class Workflow < ActiveRecord::Base
    self.table_name = 'sipity_workflows'

    has_many :entities, dependent: :destroy, class_name: 'Sipity::Entity'
    has_many :workflow_states, dependent: :destroy, class_name: 'Sipity::WorkflowState'
    has_many :workflow_actions, dependent: :destroy, class_name: 'Sipity::WorkflowAction'
    has_many :workflow_roles, dependent: :destroy, class_name: 'Sipity::WorkflowRole'

    DEFAULT_INITIAL_WORKFLOW_STATE = 'new'.freeze
    def initial_workflow_state
      workflow_states.find_or_create_by!(name: DEFAULT_INITIAL_WORKFLOW_STATE)
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
curation_concerns-1.7.8 app/models/sipity/workflow.rb
curation_concerns-1.7.7 app/models/sipity/workflow.rb
curation_concerns-2.0.0 app/models/sipity/workflow.rb
curation_concerns-2.0.0.rc2 app/models/sipity/workflow.rb
curation_concerns-1.7.6 app/models/sipity/workflow.rb
curation_concerns-1.7.5 app/models/sipity/workflow.rb
test_hyrax-0.0.1.alpha app/models/sipity/workflow.rb
curation_concerns-1.7.4 app/models/sipity/workflow.rb
curation_concerns-1.7.3 app/models/sipity/workflow.rb
curation_concerns-1.7.2 app/models/sipity/workflow.rb
curation_concerns-2.0.0.rc1 app/models/sipity/workflow.rb
curation_concerns-1.7.1 app/models/sipity/workflow.rb
curation_concerns-1.7.0 app/models/sipity/workflow.rb
curation_concerns-1.7.0.beta1 app/models/sipity/workflow.rb