Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejecting The Entire Hash #1

Open
gavinbelson opened this issue Mar 20, 2018 · 3 comments
Open

Rejecting The Entire Hash #1

gavinbelson opened this issue Mar 20, 2018 · 3 comments

Comments

@gavinbelson
Copy link

This gem works great for allowing only certain values in the .pemit. However, if the checked field is not required on the model, it will let the rest of the hash pass through. This could be an issue on the create action.

It would be amazing if this gem also rejected the entire hash if the .allow test fails.

@msimonborg
Copy link
Owner

What's the use case for this where it shouldn't just be handled at the model?

@gavinbelson
Copy link
Author

I think if you have a couple of different APIs hitting the same model. One API could allow certain fields, one could allow other fields and reject the entire hash.

@msimonborg
Copy link
Owner

I'm not sure I understand the behavior you're looking for. could you provide an example?

the purpose of the gem is to whitelist the parameter values so without an explicit example or use case I'm not clear what's missing

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

No branches or pull requests

2 participants