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

Commit e5d1d00d by Ruben Bridgewater

Fix deprecation message

1 parent d1cb281e
...@@ -1888,8 +1888,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), function() { ...@@ -1888,8 +1888,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), function() {
} }
}); });
var UserProjects = User.belongsToMany(Project, { foreignKey: { name: 'user_id', defaultValue: 42 }}); var UserProjects = User.belongsToMany(Project, { foreignKey: { name: 'user_id', defaultValue: 42 }, through: 'UserProjects' });
expect(UserProjects.through.model.rawAttributes.user_id).to.be.ok; expect(UserProjects.through.model.rawAttributes.user_id).to.be.ok;
expect(UserProjects.through.model.rawAttributes.user_id.references).to.equal(User.getTableName()); expect(UserProjects.through.model.rawAttributes.user_id.references).to.equal(User.getTableName());
expect(UserProjects.through.model.rawAttributes.user_id.referencesKey).to.equal('uid'); expect(UserProjects.through.model.rawAttributes.user_id.referencesKey).to.equal('uid');
...@@ -1902,7 +1901,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), function() { ...@@ -1902,7 +1901,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), function() {
user: Sequelize.INTEGER user: Sequelize.INTEGER
}); });
expect(User.belongsToMany.bind(User, User, { as: 'user' })).to expect(User.belongsToMany.bind(User, User, { as: 'user', through: 'UserUser' })).to
.throw ('Naming collision between attribute \'user\' and association \'user\' on model user. To remedy this, change either foreignKey or as in your association definition'); .throw ('Naming collision between attribute \'user\' and association \'user\' on model user. To remedy this, change either foreignKey or as in your association definition');
}); });
}); });
......
...@@ -1817,8 +1817,8 @@ describe(Support.getTestDialectTeaser('Include'), function() { ...@@ -1817,8 +1817,8 @@ describe(Support.getTestDialectTeaser('Include'), function() {
, Group = this.sequelize.define('Group', {}); , Group = this.sequelize.define('Group', {});
User.belongsTo(Company); User.belongsTo(Company);
User.belongsToMany(Group); User.belongsToMany(Group, { through: 'UsersGroups' });
Group.belongsToMany(User); Group.belongsToMany(User, { through: 'UsersGroups' });
return this.sequelize.sync({force: true}).then(function () { return this.sequelize.sync({force: true}).then(function () {
return User.findAll({ return User.findAll({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!