Sha256: d0f2e828be3a5ca62647fac4f63a40f198330062441bf6e734eada552c6629ca

Contents?: true

Size: 981 Bytes

Versions: 4

Compression:

Stored size: 981 Bytes

Contents

module Sipity
  # A named thing that happens within the bounds of a :workflow.
  #
  # When a Sipity::WorkflowAction is taken, it may:
  # * Advance the state to a new Sipity::WorkflowState (as defined by
  #   the :resulting_workflow_state relation)
  # * Deliver one or more notifications (as defined by the
  #   :notifiable_contexts relation)
  #
  # @see Hyrax::Forms::WorkflowActionForm
  class WorkflowAction < ActiveRecord::Base
    self.table_name = 'sipity_workflow_actions'

    belongs_to :workflow, class_name: 'Sipity::Workflow'
    belongs_to :resulting_workflow_state, class_name: 'Sipity::WorkflowState'

    has_many :workflow_state_actions, dependent: :destroy, class_name: 'Sipity::WorkflowStateAction'
    has_many :triggered_methods, dependent: :destroy, class_name: 'Sipity::Method'

    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_action.rb
hyrax-1.0.0.rc2 app/models/sipity/workflow_action.rb
hyrax-1.0.0.rc1 app/models/sipity/workflow_action.rb
test_hyrax-0.0.1.alpha app/models/sipity/workflow_action.rb