Merge pull request #1919 from emanuelschuetze/fix1904

Fixed TypeError caused by #1904.
This commit is contained in:
Norman Jäckel 2016-01-27 23:40:53 +01:00
commit da30be5184

View File

@ -149,13 +149,15 @@ angular.module('OpenSlidesApp.core', [
function (DS) {
return function (collection, instance) {
var Resource = DS.definitions[collection];
Resource.relationList.forEach(function (relationDef) {
if (relationDef.foreignKey) {
var query = {};
query[relationDef.foreignKey] = instance[Resource.idAttribute];
Resource.getResource(relationDef.relation).ejectAll(query);
}
});
if (Resource.relationList) {
Resource.relationList.forEach(function (relationDef) {
if (relationDef.foreignKey) {
var query = {};
query[relationDef.foreignKey] = instance[Resource.idAttribute];
Resource.getResource(relationDef.relation).ejectAll(query);
}
});
}
}
}
])