allowable icon indicating copy to clipboard operation
allowable copied to clipboard

Rejecting The Entire Hash

Open gavinbelson opened this issue 6 years ago • 3 comments

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.

gavinbelson avatar Mar 20 '18 19:03 gavinbelson

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

msimonborg avatar Dec 08 '18 01:12 msimonborg

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.

gavinbelson avatar Dec 08 '18 02:12 gavinbelson

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

msimonborg avatar Dec 08 '18 03:12 msimonborg