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

Resource nested hash support #42

Merged
merged 2 commits into from
Nov 19, 2013

Conversation

artempartos
Copy link
Contributor

I use Weary for my client. In some my API i use ransack and often i have a nested hash in params. For example i have rest people index api, where three hash keys.

get :people, "/api/people.json" do |resource|
      resource.optional :q, :per_page, :page
end

Here page and per_page integer option, and q - ransack search nested hash.
for example q[description_cont] or q[year_eq].
But with Weary::Resource i have error (test illustrate it)

 TypeError:
       Can't convert Hash into String.

It's famous addresable issue sporkmonger/addressable#36 which fixed in addresable 2.2.7 and broken in addresable 2.3.
I decide fix this bug here, because addresable maintainer doss't want do it (sporkmonger/addressable#84) and
minor version of Weary is higher than 2.2.

mwunsch added a commit that referenced this pull request Nov 19, 2013
@mwunsch mwunsch merged commit ef7ac66 into mwunsch:master Nov 19, 2013
@artempartos artempartos deleted the feature/nested_hash_params branch November 20, 2013 07:58
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.

2 participants