mirror of
https://github.com/ditkrg/workflower.git
synced 2026-01-22 14:17:11 +00:00
Adds uninitialization
This commit is contained in:
parent
fe4ea38ff3
commit
b30f2a1615
@ -48,6 +48,14 @@ module Workflower
|
||||
@allowed_transitions ||= @workflower_base.allowed_transitions
|
||||
end
|
||||
|
||||
def workflower_uninitializer
|
||||
@workflower_base.uninitialize
|
||||
|
||||
@possible_events = []
|
||||
@allowed_events = []
|
||||
@allowed_transitions = []
|
||||
end
|
||||
|
||||
def initialize(*)
|
||||
super
|
||||
write_attribute :workflow_id, default_workflow_id if workflow_id.blank?
|
||||
|
||||
@ -18,6 +18,20 @@ module Workflower
|
||||
@validation_errors = []
|
||||
end
|
||||
|
||||
def uninitialize
|
||||
@transitions = []
|
||||
@current_state = []
|
||||
@current_sequence = []
|
||||
@calling_model = []
|
||||
@source = []
|
||||
|
||||
# Flows
|
||||
@flows_container = []
|
||||
@events = []
|
||||
@allowed_events = []
|
||||
@validation_errors = []
|
||||
end
|
||||
|
||||
def buildup_flows
|
||||
possible_transitions.map { |transition| Workflower::Flow.new(transition) }
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user