Consider the following setup: "Product belongsTo Category".
For a product with id 1, one can get the category it belongs to via
Product.findById(1, function(err, prod) {
prod.category(function(err, cat) {
// see "cat"
});
});
The method is not exposed via the REST API, although it should be.
GET /products/1/category
404 Not Found
The primary reason is that the relation function is not enumerable (code).
Note that changing 'enumerable' to true is not enough, as the method is invoked with a wrong "this" argument when called via remoting.
@raymondfeng I am wondering how did you test the pull request #86 which was supposed to fix the issue?
Consider the following setup: "Product belongsTo Category".
For a product with id 1, one can get the category it belongs to via
The method is not exposed via the REST API, although it should be.
The primary reason is that the relation function is not enumerable (code).
Note that changing 'enumerable' to true is not enough, as the method is invoked with a wrong "this" argument when called via remoting.
@raymondfeng I am wondering how did you test the pull request #86 which was supposed to fix the issue?