Changed options.path to options.http.path
This commit is contained in:
parent
66fe60e6ca
commit
18c647a9bb
|
@ -345,7 +345,7 @@ Model.remoteMethod = function(name, options) {
|
|||
|
||||
Model.belongsToRemoting = function(relationName, relation, define) {
|
||||
var fn = this.prototype[relationName];
|
||||
var pathName = relation.options.path || relationName;
|
||||
var pathName = (relation.options.http && relation.options.http.path) || relationName;
|
||||
define('__get__' + relationName, {
|
||||
isStatic: false,
|
||||
http: {verb: 'get', path: '/' + pathName},
|
||||
|
@ -357,7 +357,7 @@ Model.belongsToRemoting = function(relationName, relation, define) {
|
|||
|
||||
Model.hasOneRemoting = function(relationName, relation, define) {
|
||||
var fn = this.prototype[relationName];
|
||||
var pathName = relation.options.path || relationName;
|
||||
var pathName = (relation.options.http && relation.options.http.path) || relationName;
|
||||
define('__get__' + relationName, {
|
||||
isStatic: false,
|
||||
http: {verb: 'get', path: '/' + pathName},
|
||||
|
@ -368,7 +368,7 @@ Model.hasOneRemoting = function(relationName, relation, define) {
|
|||
}
|
||||
|
||||
Model.hasManyRemoting = function (relationName, relation, define) {
|
||||
var pathName = relation.options.path || relationName;
|
||||
var pathName = (relation.options.http && relation.options.http.path) || relationName;
|
||||
var toModelName = relation.modelTo.modelName;
|
||||
|
||||
var findByIdFunc = this.prototype['__findById__' + relationName];
|
||||
|
@ -463,7 +463,7 @@ Model.hasManyRemoting = function (relationName, relation, define) {
|
|||
};
|
||||
|
||||
Model.scopeRemoting = function(relationName, relation, define) {
|
||||
var pathName = relation.options.path || relationName;
|
||||
var pathName = (relation.options.http && relation.options.http.path) || relationName;
|
||||
var toModelName = relation.modelTo.modelName;
|
||||
|
||||
define('__get__' + relationName, {
|
||||
|
|
|
@ -657,7 +657,9 @@ describe('relations - integration', function () {
|
|||
);
|
||||
recipe.referencesMany(ingredient);
|
||||
// contrived example for test:
|
||||
recipe.hasOne(photo, { as: 'picture', options: { path: 'image' } });
|
||||
recipe.hasOne(photo, { as: 'picture', options: {
|
||||
http: { path: 'image' }
|
||||
} });
|
||||
});
|
||||
|
||||
before(function createRecipe(done) {
|
||||
|
|
Loading…
Reference in New Issue