Pull Request: Add Associations, Validations, and Specs for Models
Description
This pull request includes the following key changes:
Added associations for the User, Team, Project, and Evaluation models to ensure correct relationships between students, instructors, teams, projects, and evaluations.
Implemented validations for models:
Ensured instructors cannot have team_id or any rating fields.
Added validation to prevent more than 6 students from being assigned to the same team.
Ensured required fields are validated across all models (User, Team, Project, Evaluation).
Updated the User model to properly handle instructor and student roles, ensuring that instructors cannot have a team as a student or have ratings.
Testing
Added RSpec to the Gemfile for model testing and validation.
Created specs for:
User model: Tested role-based logic (instructor cannot have a team or ratings).
Team model: Ensured teams cannot have more than 6 students.
Project and Evaluation models: Validated presence of required fields and correct relationships.
Dependencies
Added rspec-rails and faker to the Gemfile to support testing and mock data generation.
Pull Request: Add Associations, Validations, and Specs for Models
Description
This pull request includes the following key changes:
User
,Team
,Project
, andEvaluation
models to ensure correct relationships between students, instructors, teams, projects, and evaluations.instructors
cannot haveteam_id
or any rating fields.User
,Team
,Project
,Evaluation
).User
model to properly handle instructor and student roles, ensuring that instructors cannot have a team as a student or have ratings.Testing
Gemfile
for model testing and validation.Dependencies
rspec-rails
andfaker
to theGemfile
to support testing and mock data generation.