Wildcard transition breaks aasm.from_state
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 5.2k
- Forks
- 644
- PR merge metrics
- No merged PRs in 30d
Description
Events defined like this:
event :foo do
transition to: :bar, after: -> {
puts "event: #{aasm.current_event} | #{aasm.from_state} -> #{aasm.to_state}"
}
end
will result in empty aasm.from_state
pry(main)> statable.foo!
event: foo | -> :bar
I believe it's not intended and compromise state flow consistency
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the event and wildcard transition shown in the report, then trace how aasm.from_state is populated during the transition callback. Done means the callback reports the prior state instead of an empty value; add or update a regression test for this behavior if the existing test suite has coverage for state transitions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100