Skip to content

Commit

Permalink
Merge pull request sproutcore#548 from jzajpt/fix_sc_query_build_typo
Browse files Browse the repository at this point in the history
Fixed typo in SC.Query.build method.
  • Loading branch information
etgryphon committed Aug 3, 2011
2 parents 5620c68 + eaf55a0 commit 49e8df6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frameworks/datastore/system/query.js
Expand Up @@ -1429,7 +1429,7 @@ SC.Query.mixin( /** @scope SC.Query */ {

// pass one or more recordTypes.
if (recordType && recordType.isEnumerable) {
opts.recordsTypes = recordType;
opts.recordTypes = recordType;
} else opts.recordType = recordType;

// set conditions and params if needed
Expand Down
7 changes: 7 additions & 0 deletions frameworks/datastore/tests/system/query/builders.js
Expand Up @@ -144,6 +144,13 @@ function performBasicTests(methodName, loc) {
equals(q5, q4, 'second call for different conditions should return cache');
});

test("query with record types and conditions hash", function() {

var q = invokeWith([TestRecord, TestRecord2], {});
queryEquals(q, loc, [TestRecord, TestRecord2], null, 'first query');

});

test("query with no record type and with conditions", function() {
var q1, q2;

Expand Down

0 comments on commit 49e8df6

Please sign in to comment.