Commit e7bd2b90 authored by Oscar Godson's avatar Oscar Godson

Ticket #688 - Fix for Store#find returning on first prop match

This fixes an issue where Store#find would return any item that had just 1 property match. It now goes through every property and unless it finds a property that does NOT match the query, it assumes it's a match.
parent 793a6763
......@@ -50,9 +50,13 @@
var todos = JSON.parse(localStorage[this._dbName]).todos;
callback.call(this, todos.filter(function (todo) {
var match = true;
for (var q in query) {
return query[q] === todo[q];
if (query[q] !== todo[q]) {
match = false;
}
}
return match;
}));
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment