This repository has been archived by the owner on Aug 17, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to trust a parameter branch
This change introduces a way to mark a specific branch of the parameter hash as trusted. Using the added `StrongParameters::ANY` or `:*` allows to mark a value of the hash respectively. This functionality can be handy when your controllers already rely on strong_parameters and raising of errors is enabled. If the parameter hash contains in such a case a parameter value which is completely customizable by the consumer of the controller, it might be impossible to predefine keys.
- Loading branch information
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require 'action_controller/parameters' | ||
require 'active_model/forbidden_attributes_protection' | ||
require 'strong_parameters/any' | ||
require 'strong_parameters/railtie' | ||
require 'strong_parameters/log_subscriber' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module StrongParameters | ||
ANY = :* | ||
end |
This file contains 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