Sha256: bd9afd38eac819c69c0c9e9d74e5080942cbf87619af2c8ed3d64ec1bda3d502
Contents?: true
Size: 878 Bytes
Versions: 14
Compression:
Stored size: 878 Bytes
Contents
module Sipity # A named workflow for processing an entity. Originally I had thought of # calling this a Type, but once I extracted the Processing submodule, # type felt to much of a noun, not conveying potentiality. Workflow # conveys "things will happen" because of this. class Workflow < ActiveRecord::Base self.table_name = 'sipity_workflows' has_many :entities, dependent: :destroy, class_name: 'Sipity::Entity' has_many :workflow_states, dependent: :destroy, class_name: 'Sipity::WorkflowState' has_many :workflow_actions, dependent: :destroy, class_name: 'Sipity::WorkflowAction' has_many :workflow_roles, dependent: :destroy, class_name: 'Sipity::WorkflowRole' DEFAULT_INITIAL_WORKFLOW_STATE = 'new'.freeze def initial_workflow_state workflow_states.find_or_create_by!(name: DEFAULT_INITIAL_WORKFLOW_STATE) end end end
Version data entries
14 entries across 14 versions & 2 rubygems