Rewrite Filterable trait used for Squad filters #658
Merged
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.
Problem:
@bluedagger on discord noticed that if a character is not in any alliance, and the squad contains a filter for
alliance is not x
, the user doesn't get added to the squad, even though he should.How it has been fixed
While studying the
Filterable
trait code (https://github.com/eveseat/web/blob/c97b7cd1dd8cd5c063415ba0710d4b343dfdfef5/src/Models/Filterable.php), I noticed how messy and broken it was. I really struggled to first pin down the problem, and fixing it was even harder since it would have required to special caseis not
in multiple cases.Therefore, I decided it's rewrite time! This allowed me to fix the original bug, and additionally:
All squad tests are passing.
Lastly, I added a few files to the gitignore that were generated while running tests, but don't belong on github.