Add Enable All / Disable All assignments bulk action (#273)#354
Closed
ba88im wants to merge 1 commit into
Closed
Conversation
Adds two buttons to the instructor course view that let instructors enable or disable every assignment for a course in one click. When enabling, assignments without a due date are skipped to satisfy the existing enabled_requires_date_present validation, and the count of skipped assignments is reported back in the flash. - New PATCH /assignments/bulk_update_enabled collection route - New AssignmentsController#bulk_update_enabled action (instructor-only) - New Stimulus actions enableAll / disableAll on assignment_controller - New buttons rendered next to Sync Assignments on instructor_show - RSpec coverage for instructor success, role enforcement, due-date skipping, and missing-course handling - Cucumber scenario asserting the buttons render for instructors Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Duplicate PR |
ba88im
added a commit
that referenced
this pull request
May 1, 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.
Closes #273.
Summary
PATCH /assignments/bulk_update_enabledcollection route, backed byAssignmentsController#bulk_update_enabled. The action is instructor-only and returns JSON withupdated_countandskipped_count.due_dateare skipped so the existingenabled_requires_date_presentvalidation isn't tripped; the skip count is reported back in the flash so instructors know what happened.assignment_controller.js(enableAll/disableAll), reusing the existing CSRF + flash + reload pattern fromsync.Files changed
config/routes.rb— addcollection { patch :bulk_update_enabled }onresources :assignmentsapp/controllers/assignments_controller.rb— addbulk_update_enabledapp/views/courses/instructor_show.html.erb— add the two buttons and liftdata-controller="assignment"to a wrapper with the new valuesapp/javascript/controllers/assignment_controller.js—enableAll,disableAll,_bulkUpdatespec/controllers/assignments_controller_spec.rb— controller specs for the new actionfeatures/assignments.feature— scenario asserting the buttons render for instructorsTest plan
/assignments/bulk_update_enableddirectly — confirm 403