Closed sigfrid closed 4 years ago
Hi Sigfrid 👋
Thank you for using finite_machine
and reporting this issue.
I removed target
and alias_target
from the DSL in version v0.12.0
and made them into initialization options. As much as removing target
made for better API and reduced potentially troublesome scope issues, the alias_target
was a bit of a moot point. Reading through your issue, I decided to bring back alias_target
to DSL as it makes it much easier and more readable to have it together with the definition. I will release v0.14.0
shortly.
Released v0.14.0
.
Describe the problem
I'm upgrading a Rails app from FiniteState 0.11.3 to 0.13.0 (the upgrade seems to be needed to work with Ruby 2.7.1).
Currently, I have the following code:
Which, due the change in the API, has been updated as follows (based on https://github.com/piotrmurach/finite_machine#291-alias_target)
Steps to reproduce the problem
Actual behavior
But the change raises the following error
Expected behavior
This is not really a big issue for me since it can be fixed with
target.state = event.to
but perhaps it can cause some problems for other users.Is the error something expected?
Describe your environment