浏览代码

Add category association

sbkwgh 8 年之前
父节点
当前提交
e7db657f29
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      models/thread.js

+ 1 - 0
models/thread.js

@@ -5,6 +5,7 @@ module.exports = (sequelize, DataTypes) => {
 		classMethods: {
 			associate (models) {
 				Thread.belongsTo(models.User)
+				Thread.belongsTo(models.Category)
 				Thread.hasMany(models.Post)
 			}
 		}