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

Don't rely on Hashie::Mash (compatibility with hashie 3.3.0) #737

Closed
wants to merge 1 commit into from
Closed

Don't rely on Hashie::Mash (compatibility with hashie 3.3.0) #737

wants to merge 1 commit into from

Conversation

maciejmajewski
Copy link

Hashie 3.3.0 introduced incompatible changes to converting values in Hashie::Mash hashie/hashie#197

I am not sure if this isn't a bug in Hashie, however here is a fix making grape work with Hashie 3.3.0.

Closes #736

@dblock
Copy link
Member

dblock commented Aug 26, 2014

So the Hashie change was intentional. But maybe the key? part is a bug? Looking ...

@dblock
Copy link
Member

dblock commented Aug 26, 2014

Thanks for this. I've yanked Hashie 3.3.0, reverted hashie/hashie#197 which is the root cause of this, in hashie/hashie#217, and cut 3.3.1. Things should be back to normal now.

I do like it if Grape could not depend on Hashie::Mash though, maybe this should still be merged. What do you think @maciejmajewski?

@dblock dblock changed the title Compatibility with hashie 3.3.0 Don't rely on Hashie::Mash (compatibility with hashie 3.3.0) Aug 26, 2014
@maciejmajewski
Copy link
Author

@dblock I would use Params < ::Hash with Hashie extensions, however I would remove the convert_value method [1]. This method is required only by Grape::Validations::CoerceValidator coerces file spec [2]. Without it the returned hash has no MethodAccess-capabilities. Anyway I am wondering if the coercing there is correct, I would expect that requires :file, coerce: Rack::Multipart::UploadedFile returns instance of UploadedFile class, but returns a Hash.

[1] https://github.com/intridea/grape/pull/737/files#diff-aa7747a545932e24134dc7e9ba0fa9c6R8
[2] https://github.com/intridea/grape/blob/master/spec/grape/validations/coerce_spec.rb#L179

@dblock
Copy link
Member

dblock commented Aug 27, 2014

I am with you @maciejmajewski - convert_value here feels like a hack. Would love to see this PR go further.

@dblock
Copy link
Member

dblock commented Nov 28, 2014

Bump?

@dblock
Copy link
Member

dblock commented Apr 14, 2017

I am still interested in this after #1610

@dblock
Copy link
Member

dblock commented Nov 1, 2018

I believe this is fully addressed via #1594. Please reopen if you think otherwise.

@dblock dblock closed this Nov 1, 2018
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.

Hashie 3.3.0 Breaks All Specs
2 participants