Skip to content

Commit

Permalink
Merge pull request #61 from /issues/60-has-pagination
Browse files Browse the repository at this point in the history
set.has to ignore pagination #60
  • Loading branch information
ilyavf authored Jul 10, 2017
2 parents 90466c4 + 6caa90d commit b4d8426
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/set-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,11 @@ assign(Algebra.prototype, {
result = false;
}
else {
result = this.evaluateOperator(compare.subset, props, set, {isProperties: true}, undefined);
result = this.evaluateOperator(compare.subset, props, set, {isProperties: true}, undefined, {
shouldEvaluatePaginate: function () {
return false;
}
});
}

return result;
Expand Down
7 changes: 7 additions & 0 deletions src/set-core_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,10 @@ test('algebra.id', function(){
QUnit.equal(algebra.id({studentId: 6, classId: "7", foo: "bar"}), JSON.stringify({studentId: 6, classId: "7"}), "only one id, returns set as JSON");

});

test('set.has algebra with pagination', function () {
var algebra = new set.Algebra(set.props.offsetLimit('$skip', '$limit'));
var setA = {$limit: 5, $skip: 0};
var props = {name: 'My Portfolio'};
ok(algebra.has(setA, props));
});

0 comments on commit b4d8426

Please sign in to comment.