[#425] Fix Dataset.query() when called with Query model
The problem is that Backbone >= 0.9.9 doesn't accept updating models with:
model.set(otherModel);
That needs to be changed to:
model.set(otherModel.attributes);
Dataset.query() accepts both regular JS objects and Query models, so we need to
check the parameter type to support both.
This commit is contained in:
@@ -191,7 +191,11 @@ my.Dataset = Backbone.Model.extend({
|
||||
this.trigger('query:start');
|
||||
|
||||
if (queryObj) {
|
||||
this.queryState.set(queryObj, {silent: true});
|
||||
var attributes = queryObj;
|
||||
if (queryObj instanceof my.Query) {
|
||||
attributes = queryObj.toJSON();
|
||||
}
|
||||
this.queryState.set(attributes, {silent: true});
|
||||
}
|
||||
var actualQuery = this.queryState.toJSON();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user