JsonApiClient / json_api_client

Build client libraries compliant with specification defined by jsonapi.org
MIT License
361 stars 186 forks source link

Update resource with associations #383

Closed DanCSF closed 3 years ago

DanCSF commented 3 years ago

Hello,

I am trying to update a resource that has belongs_to and has_many associations via the update method, i can update attributes without a problem but when it comes to associations i always get undefined method 'as_json_api'.

Tried providing it as 'relationships' => , relationships: {}, relationships: ResultSet, relationship: [].

Thank You

DanCSF commented 3 years ago

In order to update a relationship you need to provide the resource name and a resultSet.