不要怂,就是干,撸起袖子干!

Commit 60d7304c by yanickouellet

Fix eager loading bug: associations with primary key of 0 were not inclunded

1 parent 3cfa2af6
Showing with 3 additions and 3 deletions
...@@ -249,7 +249,7 @@ module.exports = (function() { ...@@ -249,7 +249,7 @@ module.exports = (function() {
includeValidated: true, includeValidated: true,
raw: options.raw raw: options.raw
}) })
, isEmpty = !Utils.firstValueOfHash(daoInstance.identifiers) , isEmpty = Utils.firstValueOfHash(daoInstance.identifiers) === null
if (association.isSingleAssociation) { if (association.isSingleAssociation) {
accessor = Utils.singularize(accessor, self.sequelize.language) accessor = Utils.singularize(accessor, self.sequelize.language)
...@@ -350,9 +350,9 @@ module.exports = (function() { ...@@ -350,9 +350,9 @@ module.exports = (function() {
&& !!self.daoFactory.rawAttributes[updatedAtAttr].defaultValue && !!self.daoFactory.rawAttributes[updatedAtAttr].defaultValue
) )
? self.daoFactory.rawAttributes[updatedAtAttr].defaultValue ? self.daoFactory.rawAttributes[updatedAtAttr].defaultValue
: Utils.now(self.sequelize.options.dialect)) : Utils.now(self.sequelize.options.dialect))
} }
if (self.isNewRecord && createdAtAttr && !values[createdAtAttr]) { if (self.isNewRecord && createdAtAttr && !values[createdAtAttr]) {
values[createdAtAttr] = ( values[createdAtAttr] = (
( (
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!