File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -217,15 +217,25 @@ let(:payload) do
217
217
attributes: { },
218
218
relationships: {
219
219
employee: {
220
- data: employee.id.to_s,
221
- type: 'employees'
220
+ data: {
221
+ id: employee.id.to_s,
222
+ type: 'employees'
223
+ }
222
224
}
223
225
}
224
226
}
225
227
}
226
228
end
227
229
{% endhighlight %}
228
230
231
+ To ensure the ` PositionResource ` will process this relationship, the
232
+ last step is to add it:
233
+
234
+ {% highlight ruby %}
235
+ # app/resources/position_resource.rb
236
+ belongs_to : employee
237
+ {% endhighlight %}
238
+
229
239
This will associate the ` Position ` to the ` Employee ` as part of the
230
240
creation process. The test should now pass - make the same change to
231
241
` spec/api/v1/positions/create_spec.rb ` to get a fully-passing test
You can’t perform that action at this time.
0 commit comments