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

Params: Fix coerce_with helper and Arrays types #1325

Merged
merged 1 commit into from Mar 16, 2016
Merged

Params: Fix coerce_with helper and Arrays types #1325

merged 1 commit into from Mar 16, 2016

Conversation

ngonzalez
Copy link
Contributor

Fixes #1324, Allow using coerce_with when type is either Array[String] or Array[Integer]

@@ -136,9 +136,13 @@ def infer_type_check(type)
# Note that this will fail unless a method is also
# passed, or if the type also implements a parse() method.
type
elsif type == [Integer]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a 1-off, shouldn't it be that type.is_a?(Enumerable) of 1 simple type, and then it's value.all? of that type?

@dblock
Copy link
Member

dblock commented Mar 15, 2016

Will need CHANGELOG and possibly README changes.

@ngonzalez
Copy link
Contributor Author

@dblock Requested changes have been done and the Pull Request is updated

@@ -9,6 +9,8 @@

#### Fixes

* [#1325](https://github.com/ruby-grape/grape/pull/1325): Params: Fix coerce_with helper with Array types - [@ngonzalez](https://github.com/ngonzalez)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a period at the end ;)

@dblock
Copy link
Member

dblock commented Mar 16, 2016

Looks good. I only have minor text requests and I'll merge. Thanks for the good work.

@ngonzalez
Copy link
Contributor Author

@dblock Thanks for the code review ^ ^ I updated README and CHANGELOG

dblock added a commit that referenced this pull request Mar 16, 2016
Params: Fix coerce_with helper and Arrays types
@dblock dblock merged commit 21b58b1 into ruby-grape:master Mar 16, 2016
@dblock
Copy link
Member

dblock commented Mar 16, 2016

Merged, thanks!

@ngonzalez ngonzalez deleted the fix-coerce-with-arrays branch April 1, 2016 15:06
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.

None yet

2 participants