strongloop/loopback-datasource-juggler — pull request #99 by bajtos (2014-04-08 08:39:45+00:00)
Title: scope-like remotable metadata for belongsTo

Modify the methods created by `belongsTo` relation to mimick the methods
created by scopes (e.g. via `hasMany` relation).

This allows client code generators like loopback-angular to use the same
code for all relation types.

/to @raymondfeng or @ritch - please review.

In the future, it would be nice to extend strong-remoting to support nested objects and simplify relations & scopes by removing the delegate functions used for remoting.

```js
// Category hasMany Product

Category.prototype.products = function() { /* etc. */ }
Category.prototype.products.http = { path: 'products' };
// other remoting metadata

Category.prototype.products.create = function() { /* etc. */ }
Category.prototype.products.create.http = { verb: 'POST' , path: '/'};
// strong-remoting prepends sharedCtor and scope to the path
// result: /categories/:id/products/
```

But that's out of the scope of this pull request.