Fix for related query on non-existing column
This commit is contained in:
@@ -119,5 +119,25 @@ describe('Parse Role testing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can create role and query empty users', (done)=> {
|
||||||
|
var roleACL = new Parse.ACL();
|
||||||
|
roleACL.setPublicReadAccess(true);
|
||||||
|
var role = new Parse.Role('subscribers', roleACL);
|
||||||
|
role.save({}, {useMasterKey : true})
|
||||||
|
.then((x)=>{
|
||||||
|
var query = role.relation('users').query();
|
||||||
|
query.find({useMasterKey : true})
|
||||||
|
.then((users)=>{
|
||||||
|
done();
|
||||||
|
}, (e)=>{
|
||||||
|
fail('should not have errors');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
}, (e) => {
|
||||||
|
console.log(e);
|
||||||
|
fail('should not have errored');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ DatabaseController.prototype.loadSchema = function(acceptor = returnsTrue) {
|
|||||||
DatabaseController.prototype.redirectClassNameForKey = function(className, key) {
|
DatabaseController.prototype.redirectClassNameForKey = function(className, key) {
|
||||||
return this.loadSchema().then((schema) => {
|
return this.loadSchema().then((schema) => {
|
||||||
var t = schema.getExpectedType(className, key);
|
var t = schema.getExpectedType(className, key);
|
||||||
var match = t.match(/^relation<(.*)>$/);
|
var match = t ? t.match(/^relation<(.*)>$/) : false;
|
||||||
if (match) {
|
if (match) {
|
||||||
return match[1];
|
return match[1];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user