Merge pull request #139 from dj-hedgehog/master

fixed missing associations
This commit is contained in:
Aurélien GEORGET 2016-08-19 14:56:28 +02:00 committed by GitHub
commit c01c910eb6

View File

@ -218,7 +218,9 @@ module.exports = {
defineAssociations: function (model, definition, association, key) {
// Initialize associations object
definition.associations = [];
if (definition.associations === undefined) {
definition.associations = [];
}
// Exclude non-relational attribute
if (!association.hasOwnProperty('collection') && !association.hasOwnProperty('model')) {