Skip to content
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

E2409. Refactor sign_up_sheet_controller.rb #2777

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

Harshil47
Copy link

1.The previous version of the project fixed the naming discrepancy issue. We have validated it and found no other changes.
2.Refactored delete_signup and delete_signup_as_instructor - to create a centralized the shared functionality, delete_signup_common, a new method which lessens redundancy and enhances maintainability.
3.Refactoring the Update method to make it more concise and readable. It uses the Rails 'update_attributes' method to update multiple attributes of the @topic object in a single call. It also sets a success flash message when the topic is updated successfully, which was missing in the original code.
4.Refactoring the signup_as_instructor_action method - We have reduced the function length which was raised in the Code Climate issue. Also added multiple helper function to reduce the if-else ladder complexity. We added a new user_registered_for_assignment, process_signup_as_instructor_request helper functions as well as log_message function to make sure DRY principle is followed while logging messages.
5. Refactoring the save_topic_deadlines method Part-1 - As part 1 of refactoring save_topic_deadlines we will be reducing the number of lines of code for this function as it exceeds the limit which was raised in code climate. For this we gave create separate create and update methods of creating and saving TopicDueDate object. Additionally instance_variable_get('@assignment_' + deadline_type + 'due_dates')[i - 1] and instance_variable_get('@topic' + deadline_type + '_due_date') were used multiple number of times

sagar110599 and others added 20 commits March 23, 2024 15:37
Expertiza: Refactor update and signup_as_instructor_action methods
Refactored delete_signup and delete_signup_as_instructor as it has much in common and violates the DRY principle.
Update sign_up_sheet_controller.rb
refactored save_topic_headline function part 1
renamed methods, variables and change to fix codeql issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants