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

Add the ability to set the value of nested params #224

Merged
merged 2 commits into from
Sep 17, 2015

Conversation

cover
Copy link
Contributor

@cover cover commented Sep 17, 2015

There is a small bug when a parameter is in the path and under some scopes.

PUT /articles/:id

{
  "data": {
    "type": "articles",
    "id": "1",
    "attributes": {
      "title": "To TDD or Not"
    }
  }
}

It wasn't possible to set the internal id because it was checked the presence in the path.

I've changed to check in the path the presence of the full name (with the scope), since the id in the path won't have any scope the following will work:

parameter :id, 'path id', required: true
parameter :id, 'data id', scope: :data, required: true

let(:id) { 1 }
let(:data_id) { 1 }

I've also improved a bit the readme about scopes

@oestrich
Copy link
Contributor

This looks good. Thanks for catching this!

oestrich added a commit that referenced this pull request Sep 17, 2015
Add the ability to set the value of nested params
@oestrich oestrich merged commit 1c7f917 into zipmark:master Sep 17, 2015
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