Permalink
Browse files

Fixed typo in SC.Query.build method.

Using multiple record types and conditions hash when calling
SC.Query.build method a wrong property name was used: recordsTypes
instead of recordType.
  • Loading branch information...
1 parent da315bf commit eaf55a0396026c59e27dc4c72cd3f2b0a5c03d56 Jiří Zajpt committed Jul 13, 2011
Showing with 8 additions and 1 deletion.
  1. +1 −1 frameworks/datastore/system/query.js
  2. +7 −0 frameworks/datastore/tests/system/query/builders.js
@@ -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
@@ -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;

0 comments on commit eaf55a0

Please sign in to comment.