mirror of
https://github.com/ditkrg/workflower.git
synced 2026-01-22 22:26:40 +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
|
end
|
||||||
|
|
||||||
module ClassMethods
|
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?
|
raise Workflower::WorkflowerError, "Options can't be blank" if source.blank? || default_workflow_id.blank?
|
||||||
|
|
||||||
cattr_accessor :source, default: source
|
cattr_accessor :source, default: source
|
||||||
@ -69,7 +69,7 @@ module Workflower
|
|||||||
self.default_workflow_id = default_workflow_id
|
self.default_workflow_id = default_workflow_id
|
||||||
|
|
||||||
# self.validates "#{workflow_model.tableize.singularize}_id", presence: true
|
# 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
|
end
|
||||||
|
|
||||||
def workflower_abilities
|
def workflower_abilities
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user