A named transition from a manual step to another step.
Simple transitions have a static to target:
transition :approve, to: :doneConditional transitions have routes instead — multiple targets with when conditions:
transition :complete do
route :training, when: expr(path_type == :agency)
route :ready, when: expr(path_type == :family)
endA transition must have either to or at least one route, not both.
Routes are evaluated in declaration order and the first match wins.
Conditions see the record as it was loaded with the transition's accept
list applied, so a route can branch on an attribute the same call accepted,
while an attribute written by the action's own changes stays invisible:
transition :decide do
accept [:decision]
route :approved, when: expr(decision == :approve)
route :rejected, when: expr(decision == :reject)
end