Sha256: ca06fd2c60245349c26b341568030a5032f10044f53039d7576b9e90f7d2ce57

Contents?: true

Size: 981 Bytes

Versions: 4

Compression:

Stored size: 981 Bytes

Contents

module Sipity
  # Throughout the workflow process, a processed entity may have numerous
  # states.
  class WorkflowState < ActiveRecord::Base
    self.table_name = 'sipity_workflow_states'

    belongs_to :workflow, class_name: 'Sipity::Workflow'
    has_many :originating_workflow_state_actions,
             dependent: :destroy,
             class_name: 'Sipity::WorkflowStateAction',
             foreign_key: :originating_workflow_state_id

    has_many :resulting_workflow_actions,
             dependent: :destroy,
             class_name: 'Sipity::WorkflowAction',
             foreign_key: :resulting_workflow_state_id

    # It is not acceptable to delete a WorkflowState if there are associated entities.
    has_many :entities, class_name: 'Sipity::Entity', dependent: :restrict_with_exception

    has_many :notifiable_contexts,
             dependent: :destroy,
             as: :scope_for_notification,
             class_name: 'Sipity::NotifiableContext'
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
hyrax-1.0.1 app/models/sipity/workflow_state.rb
hyrax-1.0.0.rc2 app/models/sipity/workflow_state.rb
hyrax-1.0.0.rc1 app/models/sipity/workflow_state.rb
test_hyrax-0.0.1.alpha app/models/sipity/workflow_state.rb