geekq / workflow

Ruby finite-state-machine-inspired API for modeling workflow
MIT License
1.75k stars 207 forks source link

transitions_to shortcut #168

Closed dgmike closed 2 years ago

dgmike commented 8 years ago

Change this:

# /lib/workflow/specification.rb
target = args[:transitions_to] || args[:transition_to]

To this:

target = args[:transitions_to] || args[:transition_to] || args[:to]

So, long transitions names can be handled on one line:

# from this
event(
  :comercial_conditions_accepted,
  transitions_to: :waiting_confim_company_information
)

# to this
event :comercial_conditions_accepted, to: :waiting_company_information