Skip to content

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