Skip to content

Conversation

seanpdoyle
Copy link

Add support for handling attribute sanitization through Strong Parameters-compliant classes like ActionController::Parameters.

The implementation draws inspiration from built-in rails cases like ActiveModel::ForbiddenAttributesProtection.

To test this behavior, add the StrongParameters class to implement #permitted?, #permit!, and #to_hash.

Add support for handling [attribute sanitization][] through [Strong
Parameters][]-compliant classes like [ActionController::Parameters][].

The implementation draws inspiration from built-in `rails` cases like
[ActiveModel::ForbiddenAttributesProtection][].

To test this behavior, add the `StrongParameters` class to implement
`#permitted?`, `#permit!`, and `#to_hash`.

[attribute sanitization]: https://guides.rubyonrails.org/active_model_basics.html#attribute-assignment
[Strong Parameters]: https://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html
[ActionController::Parameters]: https://edgeapi.rubyonrails.org/classes/ActionController/Parameters.html#constant-EMPTY_HASH
[ActiveModel::ForbiddenAttributesProtection]: https://github.com/rails/rails/blob/v8.0.0.1/activemodel/lib/active_model/forbidden_attributes_protection.rb#L23-L30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant