Merge pull request #861 from ParsePlatform/fosco.role1
Fix for related query on non-existing column
This commit is contained in:
@@ -177,5 +177,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) {
|
||||
return this.loadSchema().then((schema) => {
|
||||
var t = schema.getExpectedType(className, key);
|
||||
var match = t.match(/^relation<(.*)>$/);
|
||||
var match = t ? t.match(/^relation<(.*)>$/) : false;
|
||||
if (match) {
|
||||
return match[1];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user