You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you mean by "blow away"? I would expect this to include the base author (id=123) in the primary data, and all their books, as well as all their co-authors in the included section. Moreover, I would expect every book in the response to have a fully populated authors relationship.
Not one for this repo but next best thing. This reproduces in my sample app. If you run bin/rspec spec/api/v1/employees/index_spec where that binding.pry is, you'll see that no included is coming back at all (in a different scenario ive seen included come back but relationships missing from one of the included members.). Remove the extra include of .employees and it will work again.
Ah, yes, that's an eventual issue but not relevant to the immediate one. It's originally position belongs_to employee, but as part of the commit I made it have many employees as well (at one point I was thinking it might be has-many specific). So it responds to employee and employees both.
Activity
beauby commentedon Jun 27, 2018
What do you mean by "blow away"? I would expect this to include the base author (
id=123) in the primary data, and all their books, as well as all their co-authors in theincludedsection. Moreover, I would expect every book in the response to have a fully populatedauthorsrelationship.richmolj commentedon Jun 27, 2018
This would not be the case. The relationships are removed.
beauby commentedon Jun 27, 2018
Are you providing a sparse fieldset as well? Otherwise that would be a bug.
richmolj commentedon Jun 27, 2018
No, no sparse fieldset.
beauby commentedon Jun 27, 2018
Could you provide a failing spec for this if you have one handy? I'll investigate and fix right now.
richmolj commentedon Jun 27, 2018
Not one for this repo but next best thing. This reproduces in my sample app. If you run
bin/rspec spec/api/v1/employees/index_specwhere thatbinding.pryis, you'll see that noincludedis coming back at all (in a different scenario ive seen included come back butrelationshipsmissing from one of the included members.). Remove the extra include of.employeesand it will work again.richmolj commentedon Jun 27, 2018
Otherwise it will be a little while before I can get a spec for this repo.
beauby commentedon Jun 27, 2018
has_many :employees(plural)vs
create(:position, employee: employee1)(singularemployee)Does the created resource actually respond to
.employees(plural)?richmolj commentedon Jun 27, 2018
Ah, yes, that's an eventual issue but not relevant to the immediate one. It's originally position belongs_to employee, but as part of the commit I made it have many employees as well (at one point I was thinking it might be has-many specific). So it responds to
employeeandemployeesboth.