Fix breakages caused by Crystal 1.13 #231
Open
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.
Description
There were 2 issues:
The first, 653c74c, was causing compilation to fail. I didn't investigate further because this module was clearly incorrectly (it was defining
Clear::Migration::Clear::Migration::Helper
).The second issues only affected
has_many
andbelongs_to
associations which were nilable (and defined using the?
shorthand). The reason for the breakage and a minimal fix is included in 0aa9beb. A more robust fix is then added in 8cc27f7, but with the caveat that some code may need to be updated with additionalrequire
s (so that the union type can be resolved in the macro). I would be happy to remove 8cc27f7 from this PR in order to get the minimal fix merged and then to suggest the refactoring later.Motivation and Context
Clear can't currently be used on Crystal 1.13.0 or above. Closes #230.
How Has This Been Tested?
Tests have been run, and the code has been tested against a production codebase.
Types of changes
Checklist:
bin/ameba
ran without alert.