Remove remoting metadata

This commit is contained in:
Raymond Feng 2014-06-20 23:54:46 -07:00
parent 44de2da21f
commit cbee68706f
1 changed files with 1 additions and 9 deletions

View File

@ -528,22 +528,14 @@ RelationDefinition.belongsTo = function (modelFrom, modelTo, params) {
}
});
// Wrap the property into a function for remoting
// FIXME: [rfeng] Wrap the property into a function for remoting
// so that it can be accessed as /api/<model>/<id>/<belongsToRelationName>
// For example, /api/orders/1/customer
var fn = function() {
var f = this[relationName];
f.apply(this, arguments);
};
fn.shared = true;
fn.http = {verb: 'get', path: '/' + relationName};
fn.accepts = {arg: 'refresh', type: 'boolean', http: {source: 'query'}};
fn.description = 'Fetches belongsTo relation ' + relationName;
fn.returns = {arg: relationName, type: 'object', root: true};
modelFrom.prototype['__get__' + relationName] = fn;
};
BelongsTo.prototype.create = function(targetModelData, cb) {