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

Adding with_indiferent_access to controller params #67

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

cassiascheffer
Copy link
Contributor

In Rails 4.2, to_unsafe_hash converts the params to a Hash and the
values can only be accessed with the keys as strings.

This change allows for compatibility with Rails 4.2.

In Rails 4.2, `to_unsafe_hash` converts the `params` to a Hash and the
values can only be accessed with the keys as strings.

This change allows for compatibility with Rails 4.2.
@cassiascheffer
Copy link
Contributor Author

@beauby I've tested this against Rails 5.1.4 both in a controller test and by sending a POST to the server.

https://github.com/cassidycodes/Rails-5-Test-for-jsonapi-rails/blob/master/test/controllers/test_controller_test.rb

@beauby
Copy link
Member

beauby commented Nov 17, 2017

Thanks for the PR @cassidycodes. I'll need a bit more time to figure out whether there's a better solution, but I'm keeping this under my radar.

@cassiascheffer
Copy link
Contributor Author

@beauby Ok, let me know if you want any changes on this PR.

gmkohler pushed a commit to zestyzesty/jsonapi-rails that referenced this pull request Feb 4, 2018
see jsonapi-rb#67
I just did this from the v0.3.1 tag and that PR does it from HEAD which is not published.
@gmkohler
Copy link

@dawidof bumping attention, would like to get off of a fork which includes this and #106 if at all possible (though my apps will be moving off rails 4 shortly, this seems like a no-harm change)

@baxang
Copy link

baxang commented Jun 27, 2019

Bumping this up too - can this PR be reviewed? We're still on Rails 4.2.

@dawidof dawidof merged commit 6d49925 into jsonapi-rb:master Jun 27, 2019
@baxang
Copy link

baxang commented Jun 28, 2019

@dawidof thanks for merging - Looking forward to a new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants