strongloop/loopback-datasource-juggler — pull request #327 by fabien (2014-10-12 20:04:36+00:00)
Title: Call relation methods in the right context

Before this change, it was impossible to override 'build' and other (custom) relation/scope methods; only the original prototype method was ever called. This is how scopeMethod sets things up.

The following did not work before:

```javascript
var originalBuild = scope.methods['build'];
scope.methods['build'] = function(targetModelData) {
var inst = originalBuild.apply(this, arguments);
console.log('BUILD OVERRIDE');
return inst;
};
```