-
Notifications
You must be signed in to change notification settings - Fork 89
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
Wrong array to string coercion #91
Comments
Thank you for reporting this @vpereira and apologies for the slow reply. I won't have time to look into this anytime soon, but maybe @ifellinaholeonce can help in the meantime |
hi @iMacTia you are right here! |
Thanks for bringing this up! I'll be able to take a look at this but likely not until next week. To confirm, the behaviour from |
I dont have access to the codebase right now, but as fair as i remember, the array shouldnt be valid, regardless of what is inside. |
Basic Info
Issue description
We pass in our spec the following:
And in our controller we validate this param with a:
With rails_param (0.11.2) and rails 6 the coercion happens. With rails_param (~> 1.3.0) it doesn't
Extract from pry session while running the spec:
RAILS 6
RAILS 7 and the gem 1.3.0, the exception doesn't get raised
For sure in that case I could simply validate by format, but I have more than 30 unique fails, since this is validated in many different parameters.
Steps to reproduce
I think passing an array like
%w[[email protected] [email protected]]
or as nested attributes like in my case (req[:orders_attributes][0][:email]
) having he validation asfoo.param! :email, String
should do the trick:The text was updated successfully, but these errors were encountered: