Remove remoting metadata
This commit is contained in:
parent
44de2da21f
commit
cbee68706f
|
@ -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>
|
// so that it can be accessed as /api/<model>/<id>/<belongsToRelationName>
|
||||||
// For example, /api/orders/1/customer
|
// For example, /api/orders/1/customer
|
||||||
var fn = function() {
|
var fn = function() {
|
||||||
var f = this[relationName];
|
var f = this[relationName];
|
||||||
f.apply(this, arguments);
|
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;
|
modelFrom.prototype['__get__' + relationName] = fn;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BelongsTo.prototype.create = function(targetModelData, cb) {
|
BelongsTo.prototype.create = function(targetModelData, cb) {
|
||||||
|
|
Loading…
Reference in New Issue