Add support for custom validation contexts in resource creation and update#3014
Open
goosys wants to merge 1 commit intothoughtbot:mainfrom
Open
Add support for custom validation contexts in resource creation and update#3014goosys wants to merge 1 commit intothoughtbot:mainfrom
goosys wants to merge 1 commit intothoughtbot:mainfrom
Conversation
bce9735 to
58219f1
Compare
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 pull request introduces support for customizable validation contexts when creating or updating resources in the
Administratecontrollers. This allows developers to specify different validation scenarios based on user roles or other conditions, providing more flexibility for resource validation logic. Documentation and tests have been updated to reflect and verify this new functionality.Controller enhancements for validation contexts:
validation_contexts_on_createandvalidation_contexts_on_updatemethods toAdministrate::ApplicationController, allowing developers to override and specify custom validation contexts for resource creation and update. The default context is:createor:updatebased on whether the record is new. (app/controllers/administrate/application_controller.rb)Documentation updates:
docs/customizing_controller_actions.md.Testing improvements:
spec/controllers/admin/application_controller_spec.rb.Usage: