Update acts_as_workflower.rb

This commit is contained in:
Brusk Hamarash 2021-07-31 22:56:43 +03:00 committed by GitHub
parent 7f013c34f4
commit 2a48f4c268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ module Workflower
# InstanceMethods
module InstanceMethods
# mattr_accessor :workflower_base
attr_accessor :possible_events, :allowed_events, :allowed_transitions, :workflow_transition_event_name
attr_accessor :possible_events, :allowed_events, :allowed_transitions, :workflow_transition_event_name, :workflow_transition_flow
def set_intial_state
write_attribute self.class.workflower_state_column_name, workflower_initial_state
@ -40,6 +40,7 @@ module Workflower
@workflower_base.allowed_transitions.each do |flow|
define_singleton_method flow.trigger_action_name.to_s do
@workflow_transition_event_name = flow.event
@workflow_transition_flow = flow
@workflower_base.process_transition!(flow)
end