Repository navigation
Implement create and update assignment pages - #361
Merged
bestinlalu merged 7 commits intoOct 8, 2026
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bestinlalu
force-pushed
the
feature/create-assignment-page
branch
from
September 25, 2026 13:56
126c059 to
ff0b267
Compare
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
|
🚨 RSpec Tests Report |
bestinlalu
force-pushed
the
feature/create-assignment-page
branch
from
October 6, 2026 04:54
1d3c738 to
7575adb
Compare
efg
requested changes
Oct 6, 2026
bestinlalu
force-pushed
the
feature/create-assignment-page
branch
from
October 8, 2026 03:31
b424f98 to
745d467
Compare
efg
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createandupdateendpoints for assignments, including nesteddue_dates_attributesandassignment_questionnaires_attributesAssignmentSerializer,DueDateSerializer, andAssignmentQuestionnaireSerializerfor structured API responsesAPI changes
PATCH /assignments/:idandPOST /assignmentsnow accept:due_dates_attributes— creates or updates submission, review, drop topic, signup, and team formation deadlines. Omittingdue_aton an existing record updates only theallowed_idcolumns while preserving the stored date (Railsaccepts_nested_attributes_forpartial-update behavior; theNOT NULLDB constraint is not challenged).assignment_questionnaires_attributes— creates, updates, or destroys rubric associations per round. Sends_destroy: truefor records no longer in the active set to prevent duplicates.alias_attribute(e.g.set_allowed_number_of_reviews_per_reviewer → num_reviews_allowed,is_penalty_calculated → is_penalty_calculated).Virtual attributes (
apply_late_policy,has_max_review_limit,show_template_review,calibration_for_training) are declaredattr_writeronly — permitted by strong params and accepted without error, but not persisted. The real DB columns (is_penalty_calculated,num_reviews_allowed) are what the serializer returns and what the frontend now reads.Serializer response
AssignmentSerializerreturnsis_penalty_calculatedandset_allowed_number_of_reviews_per_reviewer(not the virtual aliases).DueDateSerializerincludesdeadline_namederived fromExpertizaConstants::DeadlineTypes::NAMESso the frontend can match named deadline rows by name ('drop_topic','team_formation','signup').Migrations
add_dropdown_to_assignment_questionnairesdropdownboolean toassignment_questionnairesadd_calibrate_to_to_response_mapscalibrate_toboolean toresponse_mapsadd_missing_assignment_feature_flagshas_mentors,auto_assign_mentor,duty_based_assignment,bidding_for_reviews_enabled,enable_bidding_for_topics,enable_authors_to_review_other_topics,team_reviewing_enabledtoassignmentsSpec coverage
spec/serializers/assignment_serializer_spec.rb(new)is_penalty_calculatedis serialized;apply_late_policyis not.set_allowed_number_of_reviews_per_revieweris serialized;has_max_review_limitis not.deadline_namevalues for all three named deadline typesspec/models/assignment_spec.rb(additions)attr_writerfields are accepted but not persisted.is_penalty_calculatedround-trips through DB.set_allowed_number_of_reviews_per_revieweralias reads/writesnum_reviews_allowed. Updating named deadlineallowed_idcolumns withoutdue_atpreserves the existing datespec/requests/api/v1/assignment_controller_spec.rb(additions)PATCH /assignments/:id—is_penalty_calculatedpersists;apply_late_policyalone is a no-op; review limit alias persists; named deadline created from scratch; dropdown-only update preservesdue_at; response includes correctdeadline_nameTest plan
bundle exec rspec spec/serializers/assignment_serializer_spec.rbbundle exec rspec spec/models/assignment_spec.rbbundle exec rspec spec/requests/api/v1/assignment_controller_spec.rbbundle exec rails db:migrateon a fresh test DB — all three migrations run cleanlyPATCH /assignments/:idwithis_penalty_calculated: true→ field persists on reloadPATCH /assignments/:idwith named deadlinedue_dates_attributes(nodue_at) → existing date unchanged,allowed_idupdated