Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Refactor registration_controller.rb #250

Merged
merged 83 commits into from
Oct 11, 2023
Merged

Conversation

dunkOnIT
Copy link
Collaborator

@dunkOnIT dunkOnIT commented Oct 6, 2023

This PR introduces a number of refactors intended to reduce duplication, make the code simpler, and make some other minor improvements we've been speaking about.

Resolves #245

@FinnIckler
Copy link
Member

Any way we can get this rebased ;)?

@dunkOnIT
Copy link
Collaborator Author

dunkOnIT commented Oct 6, 2023

Lol yes my soul left my body once I came to the PR. Will get it done on Sunday :D

@dunkOnIT
Copy link
Collaborator Author

dunkOnIT commented Oct 8, 2023

@FinnIckler the diff is now accurate. Do we care about trying to resolve the long commit chain?

@dunkOnIT
Copy link
Collaborator Author

dunkOnIT commented Oct 9, 2023

  • Look into disabling rubocop super check only for RegistrationError

@dunkOnIT
Copy link
Collaborator Author

dunkOnIT commented Oct 9, 2023

  • In validate_create_request, have a user_can_create_registration method that aliases to shared logic
  • Considering refactoring the "only admins can register if comp is open (put that in the user_can_create_registration)
  • do raise/unless on one line
  • Ask ChatGPT about rewriting if params.key?(:competing)

Copy link
Member

@FinnIckler FinnIckler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just what we talked about in the call

@dunkOnIT
Copy link
Collaborator Author

All changes made, just need to go over the diff once my brain has a second to reset

@dunkOnIT dunkOnIT merged commit 9d58250 into main Oct 11, 2023
1 check passed
@dunkOnIT dunkOnIT deleted the refactor-competition-validations branch October 11, 2023 07:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Refactor how registrations_controller handles validations of incoming request information
2 participants