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
update_columns doesn't work with strong parameters #39180
Comments
I get your point, on the other hand if we add that, we'd be coupling So, I'd say to not make this change, and maybe clarify in the documentation that you should do |
This works since #33758, where |
@eugeneius I don't think it's working.. I just tried it in a fresh Rails 6 app:
Should we add |
Whoops! I tested this in a real application, where it's only working because of a monkey patch 😅 Rather than adding more methods to |
There is a reason for If developers want to pass |
@rafaelfranca I understand that we can manually call |
I think @kaspth already answered that. In my opinion it is more intention revealing that you call But I think there is something to be changed here. Do we need to skip I can't think in any case where you would end up in trouble if you pass a permitted I'd not add support to this in |
@rafaelfranca I just opened a PR. Let me know if you'd like to benchmark it in some other way (multiple columns, or something else). |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
Steps to reproduce
Expected behavior
I would expect
update_columns
to accept attributes from an instance ofActionController::Parameters
in the same way asupdate_attributes
does.Actual behavior
System configuration
Rails version: 5.2.4.2
Ruby version: 2.6.4
The text was updated successfully, but these errors were encountered: