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
217217 attributes: { },
218218 relationships: {
219219 employee: {
220- data: employee.id.to_s,
221- type: 'employees'
220+ data: {
221+ id: employee.id.to_s,
222+ type: 'employees'
223+ }
222224 }
223225 }
224226 }
225227 }
226228end
227229{% endhighlight %}
228230
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+
229239This will associate the ` Position ` to the ` Employee ` as part of the
230240creation process. The test should now pass - make the same change to
231241` 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