Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Hello! I encountered some type errors in a project related to the AASM gem. More specifically, it appears the DSL generator for AASM only supports one form of their lifecycle callbacks.
The above code would produce a typeerror along the lines of
after requires a block parameter, but no block was passed https://srb.help/7021
. However, this is in fact valid usage of theafter
hook. Similar toActiveRecord
callbacks, they accept either a block or a symbol corresponding to a method name.Implementation
This PR updates the generated
sig
s for AASM lifecycle hooks from this:To this:
Tests
I updated the relevant test.