support Relation object saving (#3074)
* support Parse.Relation object save * prevent Relation object from being saved in storage
This commit is contained in:
committed by
Florent Vilmart
parent
e9e6a4764e
commit
4ea455b20a
@@ -741,4 +741,32 @@ describe('Parse.Relation testing', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('can be saved without error', done => {
|
||||
let obj1 = new Parse.Object('PPAP');
|
||||
obj1.save()
|
||||
.then(() => {
|
||||
let newRelation = obj1.relation('aRelation');
|
||||
newRelation.add(obj1);
|
||||
obj1.save().then(() => {
|
||||
let relation = obj1.get('aRelation');
|
||||
obj1.set('aRelation', relation);
|
||||
obj1.save().then(() => {
|
||||
done();
|
||||
}, error => {
|
||||
fail('failed to save ParseRelation object');
|
||||
fail(error);
|
||||
done();
|
||||
});
|
||||
}, error => {
|
||||
fail('failed to create relation field');
|
||||
fail(error);
|
||||
done();
|
||||
});
|
||||
}, error => {
|
||||
fail('failed to save obj');
|
||||
fail(error);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user