Sha256: 386bdb306f1d61bc8a55d07f2aea2fcede6de4b4212b797ea03482d33d97ff5c

Contents?: true

Size: 1 KB

Versions: 25

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true
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

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/models/sipity/workflow_state.rb
hyrax-5.0.0 app/models/sipity/workflow_state.rb
hyrax-5.0.0.rc3 app/models/sipity/workflow_state.rb
hyrax-5.0.0.rc2 app/models/sipity/workflow_state.rb
hyrax-5.0.0.rc1 app/models/sipity/workflow_state.rb
hyrax-3.6.0 app/models/sipity/workflow_state.rb
hyrax-4.0.0 app/models/sipity/workflow_state.rb
hyrax-4.0.0.rc3 app/models/sipity/workflow_state.rb
hyrax-4.0.0.rc2 app/models/sipity/workflow_state.rb
hyrax-4.0.0.rc1 app/models/sipity/workflow_state.rb
hyrax-3.5.0 app/models/sipity/workflow_state.rb
hyrax-4.0.0.beta2 app/models/sipity/workflow_state.rb
hyrax-3.4.2 app/models/sipity/workflow_state.rb
hyrax-4.0.0.beta1 app/models/sipity/workflow_state.rb
hyrax-3.4.1 app/models/sipity/workflow_state.rb
hyrax-3.4.0 app/models/sipity/workflow_state.rb
hyrax-3.3.0 app/models/sipity/workflow_state.rb
hyrax-3.2.0 app/models/sipity/workflow_state.rb
hyrax-3.1.0 app/models/sipity/workflow_state.rb
hyrax-3.0.2 app/models/sipity/workflow_state.rb