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

Added functionality (+spec) to convert empty arrays. #125

Closed
wants to merge 1 commit into from

Conversation

croeck
Copy link

@croeck croeck commented Mar 3, 2015

As describes in issue #122 by @sheldon-b, empty arrays were not included in the converted params. This pull request fixes the issue and adds a spec to prevent future failure.

Please let me know if the pull request should be further improved.

build_nested_query(v, "#{prefix}")
end.join("&")
if value.empty?
"#{prefix}=#{escape(value)}"
Copy link

@timfjord timfjord Jan 28, 2016

Choose a reason for hiding this comment

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

This didn't work in my case(rack will parse it to '[]')
Here is my working solution
"#{prefix}[]="

Copy link

Choose a reason for hiding this comment

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

👍

@dennissivia
Copy link

"#{prefix}[]=" works for me as well.

perlun pushed a commit that referenced this pull request Apr 21, 2017
Without the patch empty arrays will be removed implicitly.
Adding this special case to ``build_nested_query`` fixes this
issue.

Implements PR #125, thanks to @croeck and @Timsly
@junaruga
Copy link
Contributor

@croeck and @Timsly thank you for the pull-request and your time.
This PR was merged as ece681d .

@junaruga junaruga closed this Apr 26, 2017
alex-damian-negru pushed a commit to alex-damian-negru/rack-test that referenced this pull request Apr 5, 2021
Without the patch empty arrays will be removed implicitly.
Adding this special case to ``build_nested_query`` fixes this
issue.

Implements PR rack#125, thanks to @croeck and @Timsly
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