mirror of
https://github.com/ditkrg/workflower.git
synced 2026-01-22 14:17:11 +00:00
Makes it possible to skip initial state setting
This commit is contained in:
parent
7fc0c61063
commit
0cd3e6957f
@ -57,7 +57,7 @@ module Workflower
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
def workflower(default_workflow_id:, source:, workflower_state_column_name: "workflow_state")
|
||||
def workflower(default_workflow_id:, source:, workflower_state_column_name: "workflow_state", skip_setting_initial_state: false)
|
||||
raise Workflower::WorkflowerError, "Options can't be blank" if source.blank? || default_workflow_id.blank?
|
||||
|
||||
cattr_accessor :source, default: source
|
||||
@ -69,7 +69,7 @@ module Workflower
|
||||
self.default_workflow_id = default_workflow_id
|
||||
|
||||
# self.validates "#{workflow_model.tableize.singularize}_id", presence: true
|
||||
before_create :set_intial_state
|
||||
before_create :set_intial_state unless skip_setting_initial_state
|
||||
end
|
||||
|
||||
def workflower_abilities
|
||||
|
||||
Loading…
Reference in New Issue
Block a user