Sha256: b461e90c5230788a04f486ead951858bd54339238680d89c42f08c109e99c847

Contents?: true

Size: 959 Bytes

Versions: 13

Compression:

Stored size: 959 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

    # TODO: What should be done with entities in the given state if the WorkflowState is destroyed?
    has_many :entities, class_name: 'Sipity::Workflow'

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

Version data entries

13 entries across 13 versions & 1 rubygems

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