strongloop/loopback-datasource-juggler — pull request #334 by pandaiolo (2014-10-17 16:29:24+00:00)
Title: Fix for HasOne relation with non-standard id

HasOne uses the following `where` condition when fetching related model :

relation-definition.js:1634:

query.where[fk] = modelInstance[pk];

Hence, `pk` seem to relate to `modelFrom`, not `modelTo` as currently implemented

When adding test specs with non-standard id, they fail, I suspect because default `id` field name is the same in both models by default.

This patch fixes the behavior and adds some tests to enforce future checking.

Impact TBD with care, specs don't seem to cover everything