-
Notifications
You must be signed in to change notification settings - Fork 172
PR from E2552 to E2557 #223
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
base: main
Are you sure you want to change the base?
Conversation
…we updated the puma version
credits to csingha - Introduced role hierarchy creation for users (Super Administrator, Administrator, Instructor, Teaching Assistant, Student). - Streamlined user creation process for instructors and students. - Added error handling for database seeding to provide clearer messages. - Improved code organization and readability by removing redundant comments and restructuring the flow.
commit f608218 Author: dmpatel3 <[email protected]> Date: Wed Apr 16 22:13:20 2025 -0400 Renamed find_team_users() to find_project_topic_team_users() and adjusted SignedUpTeam tests accordingly commit 615c2b7 Author: smiti <[email protected]> Date: Thu Apr 17 06:37:54 2025 +0530 add new tests and comments for project_topic and signed_up_team. commit 54656ae Author: smiti <[email protected]> Date: Wed Apr 16 10:41:57 2025 +0530 add new function in signed up team and its tests. commit 4b4eb90 Merge: a351623 0e067e0 Author: Adithya Srinivasan <[email protected]> Date: Mon Mar 24 17:07:24 2025 -0400 Merge branch 'main' of https://github.com/RandomOscillations/reimplementation-back-end commit a351623 Author: Adithya Srinivasan <[email protected]> Date: Mon Mar 24 17:05:06 2025 -0400 Added JSON parsing in project_topic_controller_spec.rb commit 0e067e0 Author: smiti <[email protected]> Date: Tue Mar 25 01:41:31 2025 +0530 fix the code commit 0faeb33 Author: smiti <[email protected]> Date: Mon Mar 24 09:07:34 2025 +0530 fixed the routing test file commit f6a4774 Author: dmpatel3 <[email protected]> Date: Sun Mar 23 21:54:21 2025 -0400 Added and modified tests for the ProjectTopic controller commit acecf6b Author: smiti <[email protected]> Date: Mon Mar 24 04:58:41 2025 +0530 made necessary changes commit 2793616 Author: smiti <[email protected]> Date: Sat Mar 22 05:20:54 2025 +0530 add tests and code for model commit 8ed7a4a Author: smiti <[email protected]> Date: Sat Mar 22 05:20:37 2025 +0530 add tests commit 6c0dbec Author: dmpatel3 <[email protected]> Date: Thu Mar 20 18:17:26 2025 -0400 Refactored remaining SignUpTopic-related instances across the project to ProjectTopic-related instances commit c242e16 Author: smiti <[email protected]> Date: Thu Mar 20 05:05:37 2025 +0530 refactored the project_topic model. commit 39df8eb Author: smiti <[email protected]> Date: Wed Mar 19 07:31:00 2025 +0530 Added migration file and renamed sign_up_topic to project_topic
…tency - Updated `signup_team` method to `sign_team_up` in ProjectTopic for improved readability. - Adjusted references in SignedUpTeam to call the renamed method. - Fixed DRY violation. - Commented out fixture path in RSpec configuration to resolve errors. - Updated tests to reflect method name changes and ensure proper functionality.
- Removed the API namespace from ProjectTopicsController for simplified routing. - Updated the index action comment to reflect the new endpoint structure.
- Updated ProjectTopicsController to include calculated fields in the response for project topics. - Added new methods in SignedUpTeamsController for dropping topics and teams from topics, with appropriate error handling and responses. - Refactored SignedUpTeam model to streamline the creation and deletion of signed up teams. - Updated routes to include new endpoints for dropping topics and teams. - Enhanced db/seeds.rb to create sample project topics and a test student user for easier testing.
…oved functionality - Updated ProjectTopicsController to utilize new model methods for creating, updating, and deleting project topics, enhancing code clarity and maintainability. - Refactored SignedUpTeamsController to streamline team signup and topic management processes, incorporating new business logic methods from the SignedUpTeam model. - Enhanced error handling and response messages for better API usability. - Added JSON serialization for project topics to include computed data in responses, reducing frontend processing needs.
Generated by 🚫 Danger |
…ment functionality - Added methods to get a user's team for a specific assignment and ensure a team exists for the assignment, enhancing the signup process. - Updated the sign-up logic to utilize the new methods for better handling of team assignments. - Modified the seeds file to create TeamsParticipant records, streamlining the assignment of students to teams.
|
🚨 RSpec Tests Report |
| end | ||
|
|
||
| # Business logic for creating a project topic | ||
| def self.create_topic_with_assignment(topic_params, assignment_id, micropayment = nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the method needs to be removed. the create method inside the controller will be sufficient enough
| result = ProjectTopic.create_topic_with_assignment( | ||
| project_topic_params, | ||
| params[:project_topic][:assignment_id], | ||
| params[:micropayment] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for micropayment field
|
|
||
| # Destroy ProjectTopics by assignment_id and optional topic_ids | ||
| def destroy | ||
| if params[:assignment_id].nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need this check, the project topic always belong to an assignment
| if params[:assignment_id].nil? | ||
| render json: { message: 'Assignment ID is required!' }, status: :unprocessable_entity | ||
| else | ||
| result = ProjectTopic.delete_by_assignment_and_topic_ids(params[:assignment_id], params[:topic_ids]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to loop over all topic ids and call delete method for each topic id
| belongs_to :assignment | ||
|
|
||
| # Ensures the number of max choosers is non-negative | ||
| validates :max_choosers, numericality: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider num_slots instead of max_choosers for project_topic
| end | ||
|
|
||
| # Business logic for getting team participants for a topic | ||
| def self.get_team_participants_for_topic(topic_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant methods. remove it
| private | ||
|
|
||
| # Helper method to drop existing signups for a team | ||
| def self.drop_existing_signups_for_team(team_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be instance method instead of class method,
| end | ||
|
|
||
| # Business logic for dropping a topic for a student | ||
| def self.drop_topic_for_student(user_id, topic_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be instance method for project_topic, not signed_up_team
| end | ||
|
|
||
| # Returns all users in a given team that's signed up for a topic | ||
| def self.find_project_topic_team_users(team_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need of this method. teams_users no longer exist
| team = Team.find_by(id: team_id) | ||
| return [] unless team | ||
|
|
||
| team.users.to_a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teams_users no longer exist. make it use teams_participants
No description provided.