class Project
attr_accessor :field
state_machine :state do
event :dynamic do |project|
transition to: project.calculate_statue
end
end
def calculate_state
case field do
when "something"
:rejected
when "otherthing"
:approved
end
end
end
where the state being transitioned to can be dynamically calculated via information that is stored on the class containing the state machine, similar to how the do: block works in after_transition.
Is this possible? or is this something that you would consider adding?
I would like to do something like this
where the state being transitioned to can be dynamically calculated via information that is stored on the class containing the state machine, similar to how the
do:
block works inafter_transition
.Is this possible? or is this something that you would consider adding?