Skip to content

Commit 0e7b9cd

Browse files
committed
fix(Relation): bring back Query#_defaultParams
fix "._extraOptions is undefined" error
1 parent 512826f commit 0e7b9cd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/query.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module.exports = function(AV) {
7070
this._select = [];
7171
this._limit = -1; // negative limit means, do not send a limit
7272
this._skip = 0;
73+
this._defaultParams = {};
7374
};
7475

7576
/**
@@ -278,9 +279,9 @@ module.exports = function(AV) {
278279
},
279280

280281
_getParams: function() {
281-
var params = {
282+
var params = _.extend({}, this._defaultParams, {
282283
where: this._where,
283-
};
284+
});
284285

285286
if (this._include.length > 0) {
286287
params.include = this._include.join(',');

src/relation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module.exports = function(AV) {
107107
if (!this.targetClassName) {
108108
targetClass = AV.Object._getSubclass(this.parent.className);
109109
query = new AV.Query(targetClass);
110-
query._extraOptions.redirectClassNameForKey = this.key;
110+
query._defaultParams.redirectClassNameForKey = this.key;
111111
} else {
112112
targetClass = AV.Object._getSubclass(this.targetClassName);
113113
query = new AV.Query(targetClass);

0 commit comments

Comments
 (0)