allowable
allowable copied to clipboard
Rejecting The Entire Hash
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.
What's the use case for this where it shouldn't just be handled at the model?
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.
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