Repository navigation
Replace deprecated :unprocessable_entity with :unprocessable_content - #297
Merged
Merged
Conversation
Rack still maps this status symbol to HTTP 422. The rename clears the rspec-rails have_http_status deprecation without changing responses. Co-authored-by: rsmoke <rsmoke@umich.edu>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the migration from the deprecated status symbol to :unprocessable_content.
No open issues 🎉
What changed in this PR
Replaces Rack’s deprecated :unprocessable_entity symbol with :unprocessable_content across the Rails application, preserving HTTP 422 responses.
Changes:
- Updates validation and error responses in 24 controllers.
- Aligns Devise’s responder error status with the replacement symbol.
- Updates four bulk judging window spec expectations; numeric
422checks remain unchanged.
| File | Description |
|---|---|
spec/controllers/bulk_judging_windows_controller_spec.rb |
Updates four 422 status expectations. |
config/initializers/devise.rb |
Updates the responder error status. |
app/controllers/visibilities_controller.rb |
Renames create/update error statuses. |
app/controllers/schools_controller.rb |
Renames create/update error statuses. |
app/controllers/roles_controller.rb |
Renames create/update error statuses. |
app/controllers/profiles_controller.rb |
Renames create/update error statuses. |
app/controllers/judging_rounds_controller.rb |
Updates validation and ranking error statuses. |
app/controllers/entry_rankings_controller.rb |
Updates creation and assignment error statuses. |
app/controllers/entry_awards_controller.rb |
Updates award frame error statuses. |
app/controllers/entries_controller.rb |
Updates HTML, JSON, and Turbo error statuses. |
app/controllers/editable_contents_controller.rb |
Updates the edit error status. |
app/controllers/departments_controller.rb |
Renames create/update error statuses. |
app/controllers/contest_instances_controller.rb |
Renames create/update error statuses. |
app/controllers/contest_descriptions_controller.rb |
Updates HTML and Turbo error statuses. |
app/controllers/containers_controller.rb |
Updates HTML and Turbo error statuses. |
app/controllers/class_levels_controller.rb |
Renames create/update error statuses. |
app/controllers/categories_controller.rb |
Renames create/update error statuses. |
app/controllers/campuses_controller.rb |
Renames create/update error statuses. |
app/controllers/bulk_judging_windows_controller.rb |
Updates bulk judging window error statuses. |
app/controllers/bulk_contest_instances_controller.rb |
Updates bulk creation error statuses. |
app/controllers/bulk_contest_instance_activations_controller.rb |
Updates bulk activation error statuses. |
app/controllers/awards_controller.rb |
Renames create/update error statuses. |
app/controllers/assignments_controller.rb |
Updates HTML and Turbo creation error statuses. |
app/controllers/application_questions_controller.rb |
Updates save and reorder error statuses. |
app/controllers/addresses_controller.rb |
Renames create/update error statuses. |
app/controllers/address_types_controller.rb |
Renames create/update error statuses. |
Review effort: Balanced
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.
This is a Rack deprecation rename.
:unprocessable_entityis the obsolete status symbol;:unprocessable_contentis the name Rack uses for the same response. The HTTP status stays 422. Numeric422checks were left as they are.The symbol was updated in:
render/headstatus: :unprocessable_entityacross the controllers underapp/controllers/(validation failures and JSON error responses).have_http_status(:unprocessable_entity)inspec/controllers/bulk_judging_windows_controller_spec.rb. Other specs already expected:unprocessable_content.config.responder.error_statusinconfig/initializers/devise.rb.A repo search after the change finds no remaining
:unprocessable_entity.Test plan
spec/controllers/bulk_judging_windows_controller_spec.rb(9 examples, 0 failures), including the four 422 examples.GETpages that render the layout and cannot find compiledapplication.cssin this environment. None of them are the 422 status examples.config/storage.ymlreads the GCS credentials path while loading Active Storage config. Test uploads still use the Disk service.