From eaf55a0396026c59e27dc4c72cd3f2b0a5c03d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Zajpt?= Date: Wed, 13 Jul 2011 16:20:42 +0200 Subject: [PATCH] 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. --- frameworks/datastore/system/query.js | 2 +- frameworks/datastore/tests/system/query/builders.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frameworks/datastore/system/query.js b/frameworks/datastore/system/query.js index 9ccfbe63f2..67b5dcb307 100644 --- a/frameworks/datastore/system/query.js +++ b/frameworks/datastore/system/query.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 diff --git a/frameworks/datastore/tests/system/query/builders.js b/frameworks/datastore/tests/system/query/builders.js index 968f3b511b..2cb7351706 100644 --- a/frameworks/datastore/tests/system/query/builders.js +++ b/frameworks/datastore/tests/system/query/builders.js @@ -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;