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
On calling someUser.followers.add(anotherUser), the behavior is inconsistent. Depending upon the order of relations defined in Follower, it creates a new Follower object but with wrong values of followerId & userId.
E.g. after calling someUser.followers.add(anotherUser), the correct Follower Object should be
* Fix the test cases (Raymond Feng)
* Add support for merging include filters (ningsuhen)
* add test case for hasmanythrough bi-drectional relations (ningsuhen)
* Fix for bug - #571 (ningsuhen)
I have a HasManyThrough relation from user model to user model itself via a through model "Follower".
On calling someUser.followers.add(anotherUser), the behavior is inconsistent. Depending upon the order of relations defined in Follower, it creates a new Follower object but with wrong values of followerId & userId.
E.g. after calling someUser.followers.add(anotherUser), the correct Follower Object should be
However, it can be filled incorrectly like this:
This is because of :
https://github.com/strongloop/loopback-datasource-juggler/blob/master/lib/relation-definition.js#L868
findBelongsTo returns an array of foreign keys with no specific order but as defined in the model json. But the result is consumed with the expectation that first value will be the foreign key for base model.
P.S. I have a fix for this. Will send pull request soon. this is an issue for tracking purposes in case other users find the same problem.
The text was updated successfully, but these errors were encountered: