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

Commit 8f2092a9 by Mick Hansen

Merge pull request #1965 from spektrummedia/eager_loading_primary_key

Fix eager loading bug: associations with primary key of 0 were not inclu...
2 parents 3cfa2af6 60d7304c
Showing with 3 additions and 3 deletions
......@@ -249,7 +249,7 @@ module.exports = (function() {
includeValidated: true,
raw: options.raw
})
, isEmpty = !Utils.firstValueOfHash(daoInstance.identifiers)
, isEmpty = Utils.firstValueOfHash(daoInstance.identifiers) === null
if (association.isSingleAssociation) {
accessor = Utils.singularize(accessor, self.sequelize.language)
......@@ -350,9 +350,9 @@ module.exports = (function() {
&& !!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]) {
values[createdAtAttr] = (
(
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!