-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
@@ -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] |
There was a problem hiding this comment.
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?
Will need CHANGELOG and possibly README changes. |
@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) |
There was a problem hiding this comment.
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 ;)
Looks good. I only have minor text requests and I'll merge. Thanks for the good work. |
…y[String] or Array[Integer]
@dblock Thanks for the code review ^ ^ I updated README and CHANGELOG |
Params: Fix coerce_with helper and Arrays types
Merged, thanks! |
Fixes #1324, Allow using
coerce_with
when type is eitherArray[String]
orArray[Integer]