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

Commit 4ae0663f by Mick Hansen

Merge pull request #5554 from alexanderreiff/use-pk-field-for-has-many-count

Use model.primaryKeyField for HasMany.count column
2 parents b4f3e544 6e3f07c8
Showing with 1 additions and 1 deletions
......@@ -342,7 +342,7 @@ HasMany.prototype.count = function(instance, options) {
options = association.target.__optClone(options) || {};
options.attributes = [
[sequelize.fn('COUNT', sequelize.col(model.primaryKeyAttribute)), 'count']
[sequelize.fn('COUNT', sequelize.col(model.primaryKeyField)), 'count']
];
options.raw = true;
options.plain = true;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!