-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport new features in v2 registrations to v3 #10162
base: main
Are you sure you want to change the base?
Conversation
you got your changes from the other PR in here |
This is deliberate although now that I'm thinking about it probably unnecessary |
Test failures are due to some very frustrating quirks of how competitions with no competitor limit appear to be handled in the monolith |
Can you be a bit more specific? Do you need help with figuring these quirks out? |
new_status == 'accepted' && competition.competitor_limit > 0 && Registration.accepted.count >= competition.competitor_limit This line compares competitor_limit to 0. In the microservice, this was fine as it came through as 0 in the JSON payload. In the monolith's db it is also stored as 0*, so I think the comparison with 0 is the right thing to do. However, when trying to set I see a few solutions here - probably most partial to 3 for its simplicity and the fact that it will align with what the actual values in the database are, but I don't have enough understanding to really know if it's an acceptable solution or not:
Open to other solutions here, though! *I have confirmed this using the Rails console and dbeaver for |
Sidenote: Unless I'm missing something completely obvious, aren't some of these changes the same as the other PR you just merged? |
I branched off the other PR - have just merged main in, so the diff should just be the new changes now |
Ah, now I can track what's going on much easier, and the problem you described is also clearly visible in the code now :) |
I can confirm that The answer lies in checking the actual validations that fail: validates_numericality_of :competitor_limit, greater_than_or_equal_to: 1, less_than_or_equal_to: MAX_COMPETITOR_LIMIT, if: :competitor_limit_enabled? Note the |
No description provided.