Sha256: 1d46bea150fcd836189f60d7fe3a8a71d6f4203556b7749e454a566a77df7e70

Contents?: true

Size: 997 Bytes

Versions: 54

Compression:

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

54 entries across 54 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/models/sipity/workflow_state.rb
hyrax-2.9.5 app/models/sipity/workflow_state.rb
hyrax-2.9.4 app/models/sipity/workflow_state.rb
hyrax-2.9.3 app/models/sipity/workflow_state.rb
hyrax-2.9.2 app/models/sipity/workflow_state.rb
hyrax-2.9.1 app/models/sipity/workflow_state.rb
hyrax-2.9.0 app/models/sipity/workflow_state.rb
hyrax-2.8.0 app/models/sipity/workflow_state.rb
hyrax-2.7.2 app/models/sipity/workflow_state.rb
hyrax-2.7.1 app/models/sipity/workflow_state.rb
hyrax-2.7.0 app/models/sipity/workflow_state.rb
hyrax-2.6.0 app/models/sipity/workflow_state.rb
hyrax-3.0.0.pre.rc1 app/models/sipity/workflow_state.rb
hyrax-3.0.0.pre.beta3 app/models/sipity/workflow_state.rb
hyrax-2.5.1 app/models/sipity/workflow_state.rb
hyrax-2.5.0 app/models/sipity/workflow_state.rb
hyrax-3.0.0.pre.beta2 app/models/sipity/workflow_state.rb
hyrax-2.4.1 app/models/sipity/workflow_state.rb
hyrax-3.0.0.pre.beta1 app/models/sipity/workflow_state.rb
hyrax-2.4.0 app/models/sipity/workflow_state.rb