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

Rails 5 ActionController::Parameters no longer inherits from Hash #381

Closed
scarhand opened this issue Aug 30, 2016 · 3 comments · Fixed by #383
Closed

Rails 5 ActionController::Parameters no longer inherits from Hash #381

scarhand opened this issue Aug 30, 2016 · 3 comments · Fixed by #383
Assignees
Labels

Comments

@scarhand
Copy link

In Rails 5 ActionController::Parameters no longer inherits from Hash.

Therefor something like MyInteraction.run(params) will fail with the ArgumentError "inputs must be a hash".

@tfausak tfausak added the bug label Aug 30, 2016
@tfausak
Copy link
Collaborator

tfausak commented Aug 30, 2016

This is pretty similar to #379. There are a few workarounds in there. The easiest fix is to use params.to_unsafe_h. But perhaps we need a better story for this. What do you think, @AaronLasseigne?

@scarhand
Copy link
Author

@tfausak yeah, that's the fix I'm using right now. Even if you decide not to fix this, it would be nice if the documentation would make notice of the workaround.

@AaronLasseigne
Copy link
Owner

This might be a big enough problem to warrant a fix. If not then we definitely should do as @scarhand suggests and update the docs.

We could check for this one specific class name and convert it rather than implementing a generic to_h (which I agree is not good).

@tfausak tfausak self-assigned this Sep 8, 2016
tfausak added a commit that referenced this issue Sep 8, 2016
tfausak added a commit that referenced this issue Sep 13, 2016
Allow ActionController::Parameters as inputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants